Fix clicking on inventory slots (#37)

* Fix clicking on inventory slots.

* resort to hacks

* one more hack
This commit is contained in:
Jason Mitchell authored and GitHub committed 2022-01-09 18:46:27 -08:00
1 parent 1c46541223
commit 171d1b3f25
1 file changed
+19 -3
@@ -375,9 +375,9 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler {
chestLeft = guiLeft - chestWidth;
chestTop = guiTop;
// Leaving out the xsize increase by chestSize and adjusting where it's used, because otherwise it shifts both the bookmarks and item panel
// way too far out.
//xSize += guiLeft - chestLeft;
// Leaving out the xSize increase by chestSize and adjusting where it's used, because otherwise it shifts both the bookmarks and item panel
// way too far out. If anything (mouseClick, for example) relies on xSize, you'll need to hack it like below.
// xSize += guiLeft - chestLeft;
guiLeft = chestLeft;
if (logic.doubleChest != null)
@@ -393,6 +393,22 @@ public class CraftingStationGui extends GuiContainer implements INEIGuiHandler {
updateChestSlots();
}
@Override
protected void mouseClicked(int x, int y, int button) {
// Hacks
xSize += chestWidth;
super.mouseClicked(x, y, button);
xSize -= chestWidth;
}
@Override
protected void mouseMovedOrUp(int x, int y, int button) {
// Hacks
xSize += chestWidth;
super.mouseMovedOrUp(x, y, button);
xSize -= chestWidth;
}
// updates slot visibility
protected void updateChestSlots() {