From 4f59ed6ea0b43f2741bada61587146467780c566 Mon Sep 17 00:00:00 2001 From: Ranzu <66495944+Ranzuu@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:50:23 +0100 Subject: [PATCH] Fixes Inventory Tab Pixels (#259) --- .../java/tconstruct/client/tabs/AbstractTab.java | 6 ++++++ .../client/tabs/InventoryTabVanilla.java | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/main/java/tconstruct/client/tabs/AbstractTab.java b/src/main/java/tconstruct/client/tabs/AbstractTab.java index 2b5fbdbf..6f1e2939 100644 --- a/src/main/java/tconstruct/client/tabs/AbstractTab.java +++ b/src/main/java/tconstruct/client/tabs/AbstractTab.java @@ -45,6 +45,9 @@ public abstract class AbstractTab extends GuiButton { mc.renderEngine.bindTexture(this.texture); this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + if (this.enabled) { + this.drawUnselectedTabDecorations(mc, xOffset, yTexPos, yPos, ySize); + } RenderHelper.enableGUIStandardItemLighting(); this.zLevel = 100.0F; @@ -69,6 +72,9 @@ public abstract class AbstractTab extends GuiButton { } } + protected void drawUnselectedTabDecorations(Minecraft mc, int textureXOffset, int textureYStart, int tabTopY, + int tabHeight) {} + @Override public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) { boolean inWindow = this.enabled && this.visible diff --git a/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java b/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java index 699e2b0c..dbfa85ef 100644 --- a/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java +++ b/src/main/java/tconstruct/client/tabs/InventoryTabVanilla.java @@ -1,5 +1,6 @@ package tconstruct.client.tabs; +import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -18,4 +19,18 @@ public class InventoryTabVanilla extends AbstractTab { public boolean shouldAddToList() { return true; } + + @Override + protected void drawUnselectedTabDecorations(Minecraft mc, int textureXOffset, int textureYStart, int tabTopY, + int tabHeight) { + int textureX = textureXOffset * 28; + int sourceY = 29; + int targetY = tabTopY + tabHeight; + + // Extend the bottom-left corner on the unselected vanilla tab. + // 0,29 -> two extra pixels down; 1,29 -> one extra pixel down. + this.drawTexturedModalRect(this.xPosition, targetY, textureX, sourceY, 1, 1); + this.drawTexturedModalRect(this.xPosition, targetY + 1, textureX, sourceY, 1, 1); + this.drawTexturedModalRect(this.xPosition + 1, targetY, textureX + 1, sourceY, 1, 1); + } }