diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java | 15 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java | 8 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 0933c1a7..6ebcc04f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -1003,6 +1003,11 @@ public class NEUEventListener { if(button.anchorBottom) { y += ySize; } + if(AccessoryBagOverlay.isInAccessoryBag()){ + if(x > guiLeft + xSize && x < guiLeft + xSize + 80 + 28+ 5 && y > guiTop-18 && y < guiTop + 150){ + x += 80+28; + } + } GlStateManager.color(1, 1, 1, 1f); @@ -1105,6 +1110,11 @@ public class NEUEventListener { if(button.anchorBottom) { y += ySize; } + if(AccessoryBagOverlay.isInAccessoryBag()){ + if(x > guiLeft + xSize && x < guiLeft + xSize + 80 + 28+ 5 && y > guiTop-18 && y < guiTop + 150){ + x += 80+28; + } + } if(x-guiLeft >= 85 && x-guiLeft <= 115 && y-guiTop >= 4 && y-guiTop <= 25) { disableCraftingText = true; @@ -1430,6 +1440,11 @@ public class NEUEventListener { if(button.anchorBottom) { y += ySize; } + if(AccessoryBagOverlay.isInAccessoryBag()){ + if(x > guiLeft + xSize && x < guiLeft + xSize + 80 + 28+ 5 && y > guiTop-18 && y < guiTop + 150){ + x += 80+28; + } + } if(mouseX >= x && mouseX <= x+18 && mouseY >= y && mouseY <= y+18) { if(Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java index b2d301a6..728d4478 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -582,13 +582,19 @@ public class AccessoryBagOverlay { return o1.compareTo(o2); }; } + private static boolean inAccessoryBag = false; + public static boolean isInAccessoryBag(){ + return inAccessoryBag; + } - public static void renderOverlay() { + public static void renderOverlay() { + inAccessoryBag = false; if(Minecraft.getMinecraft().currentScreen instanceof GuiChest && NEUEventListener.inventoryLoaded) { GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); if(containerName.trim().startsWith("Accessory Bag")) { + inAccessoryBag = true; try { int xSize = (int) Utils.getField(GuiContainer.class, eventGui, "xSize", "field_146999_f"); int ySize = (int) Utils.getField(GuiContainer.class, eventGui, "ySize", "field_147000_g"); |