Skip to content

Commit

Permalink
Fix ClickGui icon rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
TangyKiwi committed Jun 23, 2023
1 parent 56a19f2 commit 89f1009
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/main/java/com/tangykiwi/kiwiclient/gui/window/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,15 @@ public void render(DrawContext context, int mouseX, int mouseY) {

/* window icon */
if (icon != null) {
RenderSystem.getModelViewStack().push();
RenderSystem.getModelViewStack().translate(x1 + (blockItem ? 3 : 2), y1 + 1, 0);
RenderSystem.getModelViewStack().scale(0.6f, 0.6f, 1f);
matrices.push();
matrices.translate(x1 + (blockItem ? 3 : 2), y1 + 1, 0);
matrices.scale(0.6f, 0.6f, 1f);

DiffuseLighting.enableGuiDepthLighting();
context.drawItem(icon, 0, 0);
DiffuseLighting.disableGuiDepthLighting();

RenderSystem.getModelViewStack().pop();
RenderSystem.applyModelViewMatrix();
matrices.pop();
}

/* window title */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
import com.tangykiwi.kiwiclient.event.DrawOverlayEvent;
import com.tangykiwi.kiwiclient.modules.Category;
import com.tangykiwi.kiwiclient.modules.Module;
import com.tangykiwi.kiwiclient.util.render.color.ColorUtil;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;

Expand All @@ -22,7 +19,6 @@ public InventoryViewer() {
@Subscribe
public void onDrawOverlay(DrawOverlayEvent e) {
DrawContext context = e.getContext();
ItemRenderer itemRenderer = mc.getItemRenderer();
ClientPlayerEntity player = mc.player;

int scaledWidth = mc.getWindow().getScaledWidth();
Expand Down

0 comments on commit 89f1009

Please sign in to comment.