diff options
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java index 3e096d5b..7ca79d08 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java @@ -50,6 +50,7 @@ public class AbiphoneFavourites { private static final AbiphoneFavourites INSTANCE = new AbiphoneFavourites(); private long lastClick = 0L; + private boolean isInShowMenu = false; public static AbiphoneFavourites getInstance() { return INSTANCE; @@ -204,10 +205,16 @@ public class AbiphoneFavourites { @SubscribeEvent public void onDrawBackground(GuiContainerBackgroundDrawnEvent event) { - if (isWrongInventory()) return; + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() + || !NotEnoughUpdates.INSTANCE.config.misc.abiphoneFavourites + || Utils.getOpenChestName().equals("Abiphone Shop") + || !Utils.getOpenChestName().startsWith("Abiphone ")) return; GuiContainer container = event.getContainer(); + ItemStack checkForShowMenu = container.inventorySlots.getSlot(1*9 + 4).getStack(); + isInShowMenu = checkForShowMenu != null && checkForShowMenu.getDisplayName().contains("Abiphone "); + for (Slot slot : container.inventorySlots.inventorySlots) { if (slot == null) continue; ItemStack stack = slot.getStack(); @@ -230,7 +237,8 @@ public class AbiphoneFavourites { return !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() || !NotEnoughUpdates.INSTANCE.config.misc.abiphoneFavourites || Utils.getOpenChestName().equals("Abiphone Shop") - || !Utils.getOpenChestName().startsWith("Abiphone "); + || !Utils.getOpenChestName().startsWith("Abiphone ") + || isInShowMenu; } private boolean isContact(ItemStack stack) { |