diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 8bd7c581..74409648 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -26,7 +26,6 @@ import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeLis import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.init.Blocks; @@ -93,6 +92,7 @@ public class SBInfo { */ @Deprecated public String currentlyOpenChestName = ""; + public String lastOpenChestName = ""; private long lastManualLocRaw = -1; private long lastLocRaw = -1; @@ -127,7 +127,8 @@ public class SBInfo { private int tickCount = 0; public String currentProfile = null; - @SubscribeEvent + //Set the priority HIGH to allow other GuiOpenEvent's to use the new currentlyOpenChestName data + @SubscribeEvent(priority = EventPriority.HIGH) public void onGuiOpen(GuiOpenEvent event) { if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; @@ -136,6 +137,7 @@ public class SBInfo { ContainerChest container = (ContainerChest) chest.inventorySlots; currentlyOpenChestName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); + lastOpenChestName = currentlyOpenChestName; } else { currentlyOpenChestName = ""; } @@ -230,6 +232,7 @@ public class SBInfo { this.setLocation(null); joinedWorld = System.currentTimeMillis(); currentlyOpenChestName = ""; + lastOpenChestName = ""; hasNewTab = false; } |
