From 9e2c7e76415e1d0d6c8f2af7ba83f1444875d7fc Mon Sep 17 00:00:00 2001 From: Serghei Borovetchi Date: Sat, 19 Feb 2022 19:33:57 +0200 Subject: [PATCH] fix-crafting-station-height --- .../tools/gui/CraftingStationGui.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/tconstruct/tools/gui/CraftingStationGui.java b/src/main/java/tconstruct/tools/gui/CraftingStationGui.java index 447c932a..f35ca9b6 100644 --- a/src/main/java/tconstruct/tools/gui/CraftingStationGui.java +++ b/src/main/java/tconstruct/tools/gui/CraftingStationGui.java @@ -380,9 +380,6 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler { // xSize += guiLeft - chestLeft; guiLeft = chestLeft; - if (logic.doubleChest != null) - this.ySize = 187; - border.setPosition(chestLeft, chestTop); border.setSize(chestWidth, chestHeight + (shouldDrawName() ? textBackground.h : 0) + 2 * border.h); @@ -397,17 +394,31 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler { @Override protected void mouseClicked(int x, int y, int button) { // Hacks + final int height = ySize; + + if (logic.chest != null && x >= guiLeft && x <= guiLeft + chestWidth) { + ySize = border.height; + } + xSize += chestWidth; super.mouseClicked(x, y, button); xSize -= chestWidth; + ySize = height; } @Override protected void mouseMovedOrUp(int x, int y, int button) { // Hacks + final int height = ySize; + + if (logic.chest != null && x >= guiLeft && x <= guiLeft + chestWidth) { + ySize = border.height; + } + xSize += chestWidth; super.mouseMovedOrUp(x, y, button); - xSize -= chestWidth; + xSize -= chestWidth; + ySize = height; } // updates slot visibility