aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorGrowlingGrizzly <52770460+GrowlingGrizzly@users.noreply.github.com>2024-03-12 07:37:31 -0400
committerGitHub <noreply@github.com>2024-03-12 12:37:31 +0100
commit306d616eae6de1323d23545c49092cb83df8e67a (patch)
tree0dba9a3ac3e5321175f7125b814fee730c627b0a /src/main/java/io
parente6cf81f7fd2389d1fd4a3d312cdfa3308d09279c (diff)
downloadNotEnoughUpdates-306d616eae6de1323d23545c49092cb83df8e67a.tar.gz
NotEnoughUpdates-306d616eae6de1323d23545c49092cb83df8e67a.tar.bz2
NotEnoughUpdates-306d616eae6de1323d23545c49092cb83df8e67a.zip
fix: abiphone favorites showing in /show (#1042)
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneFavourites.java12
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) {