diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-02-10 00:31:43 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-02-10 00:31:43 +0800 |
| commit | e782e847ccc0eadc4d6e58068ed36d30ce233899 (patch) | |
| tree | d7bc8f605889cc9b040e69bd13faef8ab1cd75e3 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | |
| parent | 05ecb9ec0980fbf3eb074deb021d6b06172b8fd2 (diff) | |
| download | notenoughupdates-e782e847ccc0eadc4d6e58068ed36d30ce233899.tar.gz notenoughupdates-e782e847ccc0eadc4d6e58068ed36d30ce233899.tar.bz2 notenoughupdates-e782e847ccc0eadc4d6e58068ed36d30ce233899.zip | |
PRE18
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 | 21 |
1 files changed, 21 insertions, 0 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 1e29fb5e..314096aa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -2,14 +2,19 @@ package io.github.moulberry.notenoughupdates.util; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.inventory.ContainerChest; import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.scoreboard.Scoreboard; import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -34,6 +39,8 @@ public class SBInfo { public Date currentTimeDate = null; + public String lastOpenContainerName = null; + public static SBInfo getInstance() { return INSTANCE; } @@ -42,10 +49,24 @@ public class SBInfo { private JsonObject locraw = null; @SubscribeEvent + public void onGuiOpen(GuiOpenEvent event) { + if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return; + + if(event.gui instanceof GuiChest) { + GuiChest chest = (GuiChest) event.gui; + ContainerChest container = (ContainerChest) chest.inventorySlots; + String containerName = container.getLowerChestInventory().getDisplayName().getUnformattedText(); + + lastOpenContainerName = containerName; + } + } + + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { lastLocRaw = -1; locraw = null; mode = null; + lastOpenContainerName = null; } @SubscribeEvent |
