diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2023-10-14 16:57:45 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-14 16:57:45 +0900 |
commit | 51c17b43e59608dc711519193f77be917e69f97e (patch) | |
tree | fc59143d4beaba0da0e08a88008005765f2ee047 | |
parent | 5afdc28833bd705b9e1b622352fd258ab7ecd662 (diff) | |
download | Skyblock-Dungeons-Guide-51c17b43e59608dc711519193f77be917e69f97e.tar.gz Skyblock-Dungeons-Guide-51c17b43e59608dc711519193f77be917e69f97e.tar.bz2 Skyblock-Dungeons-Guide-51c17b43e59608dc711519193f77be917e69f97e.zip |
Hud feature visibility check fix (#424)
* - Make it check visilbility when exiting skyblock, fixes #367
Signed-off-by: syeyoung <cyoung06@naver.com>
* - a small formatting fix: SkyblockStatus static access
Signed-off-by: syeyoung <cyoung06@naver.com>
* - Fix soulroom warning displaying outside of skyblock if dungeon was exited mid-run
Signed-off-by: syeyoung <cyoung06@naver.com>
---------
Signed-off-by: syeyoung <cyoung06@naver.com>
41 files changed, 65 insertions, 96 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/DiscordIntegrationManager.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/DiscordIntegrationManager.java index 6012a24a..44bdf4c0 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/DiscordIntegrationManager.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/discord/DiscordIntegrationManager.java @@ -187,8 +187,6 @@ public class DiscordIntegrationManager implements IPCListener { } catch (Throwable e) {e.printStackTrace();} } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - private void sendRichPresence(RichPresence presence) { ipcClient.send(new JSONObject() .put("cmd","SET_ACTIVITY") @@ -197,11 +195,11 @@ public class DiscordIntegrationManager implements IPCListener { .put("activity",presence == null ? null : presence.toJson())), new Callback(success ->{}, fail -> {System.out.println(fail);})); } private void updatePresence() { - if (!skyblockStatus.isOnHypixel() || !FeatureRegistry.DISCORD_RICHPRESENCE.isEnabled() || (!skyblockStatus.isOnSkyblock() && FeatureRegistry.DISCORD_RICHPRESENCE.<Boolean>getParameter("disablenotskyblock").getValue())) { + if (!SkyblockStatus.isOnHypixel() || !FeatureRegistry.DISCORD_RICHPRESENCE.isEnabled() || (!SkyblockStatus.isOnSkyblock() && FeatureRegistry.DISCORD_RICHPRESENCE.<Boolean>getParameter("disablenotskyblock").getValue())) { sendRichPresence(null); } else { String name = SkyblockStatus.locationName == null ? "" : SkyblockStatus.locationName; - if (!skyblockStatus.isOnSkyblock()) name ="Somewhere on Hypixel"; + if (!SkyblockStatus.isOnSkyblock()) name ="Somewhere on Hypixel"; if (name.trim().equals("Your Island")) name = "Private Island"; RichPresence.Builder presence = new RichPresence.Builder(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java index 23c5a3d8..a76dff51 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/GeneralRoomProcessor.java @@ -24,6 +24,7 @@ import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonRoomDoor; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret; import kr.syeyoung.dungeonsguide.dungeon.mechanics.dunegonmechanic.DungeonMechanic; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonActionContext; import kr.syeyoung.dungeonsguide.mod.dungeon.DungeonContext; @@ -248,7 +249,7 @@ public class GeneralRoomProcessor implements RoomProcessor { private long secrets2 = 0; @Override public void actionbarReceived(IChatComponent chat) { - if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (dungeonRoom.getTotalSecrets() == -1) { ChatTransmitter.sendDebugChat(new ChatComponentText(chat.getFormattedText().replace('§', '&') + " - received")); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java index 03ce249d..6adcaf9e 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/PacketListener.java @@ -40,13 +40,12 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class PacketListener { - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @SubscribeEvent public void onPacketReceive(RawPacketReceivedEvent event) { try { Packet packet = event.packet; - if (skyblockStatus.isOnSkyblock() + if (SkyblockStatus.isOnSkyblock() && packet instanceof S04PacketEntityEquipment && FeatureRegistry.FIX_SPIRIT_BOOTS.isEnabled()) { // Inventory packet name S04PacketEntityEquipment packet2 = (S04PacketEntityEquipment) packet; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java index 905500fa..93705de8 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebugTrap.java @@ -40,8 +40,6 @@ public class FeatureDebugTrap extends TextHUDFeature { registerDefaultStyle("batsamm", DefaultingDelegatingTextStyle.derive("Feature Default - Batsamm", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - static List<Long> avgStorage = new ArrayList<>(); public static void updateVal(long timeItTookForThePacketToProcess){ @@ -60,7 +58,7 @@ public class FeatureDebugTrap extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null; } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java index ac4f0581..669a8da4 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureDebuggableMap.java @@ -44,7 +44,6 @@ public class FeatureDebuggableMap extends RawRenderingGuiFeature { DynamicTexture dynamicTexture = new DynamicTexture(128, 128); ResourceLocation location = Minecraft.getMinecraft().renderEngine.getDynamicTextureLocation("dungeons/map/", dynamicTexture); - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public void drawHUD(float partialTicks) { // if (!skyblockStatus.isOnDungeon()) return; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java index 1b9237af..486522af 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -45,8 +45,6 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { .setTextShader(new AColor(Color.yellow.getRGB(),true))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public TextSpan getDummyText() { @@ -57,7 +55,7 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { @Override public boolean isHUDViewable() { - if (!skyblockStatus.isOnDungeon()) return false; + if (!SkyblockStatus.isOnDungeon()) return false; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return false; @@ -73,7 +71,7 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { @Override public TextSpan getText() { - if (!skyblockStatus.isOnDungeon()) return new TextSpan(new NullTextStyle(), ""); + if (!SkyblockStatus.isOnDungeon()) return new TextSpan(new NullTextStyle(), ""); DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return new TextSpan(new NullTextStyle(), ""); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java index 53fe52b6..bcc7885f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomDebugInfo.java @@ -44,8 +44,6 @@ public class FeatureRoomDebugInfo extends TextHUDFeature { .setTextShader(new AColor(Color.white.getRGB(),true))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public TextSpan getDummyText() { return new TextSpan(getStyle("info"), "Line 1\nLine 2\nLine 3\nLine 4\nLine 5"); @@ -53,7 +51,7 @@ public class FeatureRoomDebugInfo extends TextHUDFeature { @Override public boolean isHUDViewable() { - if (!skyblockStatus.isOnDungeon()) return false; + if (!SkyblockStatus.isOnDungeon()) return false; if (!FeatureRegistry.DEBUG.isEnabled()) return false; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return false; @@ -62,7 +60,7 @@ public class FeatureRoomDebugInfo extends TextHUDFeature { @Override public TextSpan getText() { - if (!skyblockStatus.isOnDungeon()) return new TextSpan(new NullTextStyle(), ""); + if (!SkyblockStatus.isOnDungeon()) return new TextSpan(new NullTextStyle(), ""); if (!FeatureRegistry.DEBUG.isEnabled()) return new TextSpan(new NullTextStyle(), ""); DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return new TextSpan(new NullTextStyle(), ""); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java index 9f2b6a1a..4620c02f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureTestPeople.java @@ -22,6 +22,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.TCDouble; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; @@ -450,7 +451,7 @@ public class FeatureTestPeople extends RawRenderingGuiFeature { String genPlayerText(String username) { - if (DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) { + if (SkyblockStatus.isOnDungeon()) { if (Objects.equals(username, Minecraft.getMinecraft().getSession().getUsername())) { return ": In Dungeon"; } else if (isPlayerInDungeon(username)) { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java index 0b336876..6ba136ff 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureBoxRealLivid.java @@ -41,11 +41,10 @@ public class FeatureBoxRealLivid extends SimpleFeature { AColor color = null; - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @DGEventHandler public void drawWorld(RenderWorldLastEvent event) { float partialTicks = event.partialTicks; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() == null) return; if (!(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorLivid)) return; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java index c2c28342..49ee5497 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureChestPrice.java @@ -20,6 +20,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.boss; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.features.SimpleFeature; import kr.syeyoung.dungeonsguide.mod.utils.AhUtils; @@ -50,7 +51,7 @@ public class FeatureChestPrice extends SimpleFeature { @DGEventHandler public void onGuiBGRender(GuiScreenEvent.BackgroundDrawnEvent rendered) { if (!(rendered.gui instanceof GuiChest)) return; - if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; GlStateManager.disableLighting(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java index e22a70e3..21071f77 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureCurrentPhase.java @@ -37,11 +37,9 @@ public class FeatureCurrentPhase extends TextHUDFeature { registerDefaultStyle("phase", DefaultingDelegatingTextStyle.derive("Feature Default - Phase", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() != null; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() != null; } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java index 801a62a7..5aff41a9 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureHideAnimals.java @@ -48,12 +48,10 @@ public class FeatureHideAnimals extends SimpleFeature { - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @DGEventHandler() public void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent) { - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() == null) return; if (!(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java index a4762b5f..047893ac 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureTerracotaTimer.java @@ -40,11 +40,9 @@ public class FeatureTerracotaTimer extends TextHUDFeature { registerDefaultStyle("time", DefaultingDelegatingTextStyle.derive("Feature Default - Time", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorSadan && + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorSadan && "fight-1".equalsIgnoreCase(DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor().getCurrentPhase()); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java index 1b3db01f..87f081d4 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornBearPercentage.java @@ -39,11 +39,9 @@ public class FeatureThornBearPercentage extends TextHUDFeature { registerDefaultStyle("unit", DefaultingDelegatingTextStyle.derive("Feature Default - Unit", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn; } @Override public TextSpan getDummyText() { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java index 951e3d02..799d44a0 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureThornSpiritBowTimer.java @@ -41,11 +41,9 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature { registerDefaultStyle("time", DefaultingDelegatingTextStyle.derive("Feature Default - Time", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn && time > System.currentTimeMillis(); + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn && time > System.currentTimeMillis(); } @@ -70,7 +68,7 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature { @DGEventHandler() public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { - if (!(skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; + if (!(SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; String text = clientChatReceivedEvent.message.getFormattedText(); if (text.equals("§r§a§lThe §r§5§lSpirit Bow §r§a§lhas dropped!§r")) { time = System.currentTimeMillis() + 16000; @@ -94,7 +92,7 @@ public class FeatureThornSpiritBowTimer extends TextHUDFeature { @DGEventHandler public void onTitle(TitleEvent event) { - if (!(skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; + if (!(SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return; if (event.getPacketTitle().getMessage().getFormattedText().contains("picked up")) { time = System.currentTimeMillis() + 21000; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java index 63c217f3..a11f34ad 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/FeatureWarningOnPortal.java @@ -102,7 +102,6 @@ public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextP return dummyText; } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public List<StyledText> getText() { ArrayList<StyledText> texts = new ArrayList<StyledText>(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java index 337bf613..989a7e65 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/boss/terminal/FeatureSimonSaysSolver.java @@ -44,7 +44,6 @@ public class FeatureSimonSaysSolver extends SimpleFeature { super("Bossfight.Floor 7","Simon Says Solver","Solver for Simon says puzzle", "Dungeon.Bossfight.simonsays2"); } - private final SkyblockStatus ss = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); private final List<BlockPos> orderBuild = new ArrayList<BlockPos>(); private final LinkedList<BlockPos> orderClick = new LinkedList<BlockPos>(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java index c74f8dbc..1f8771a9 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxBats.java @@ -45,12 +45,11 @@ public class FeatureBoxBats extends SimpleFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @DGEventHandler public void drawWorld(RenderWorldLastEvent event) { float partialTicks = event.partialTicks; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; final BlockPos player = Minecraft.getMinecraft().thePlayer.getPosition(); int val = this.<Integer>getParameter("radius").getValue(); @@ -66,7 +65,7 @@ public class FeatureBoxBats extends SimpleFeature { AColor c = this.<AColor>getParameter("color").getValue(); for (EntityBat entitySkeleton : skeletonList) { if (!entitySkeleton.isInvisible()) - RenderUtils.highlightBox(entitySkeleton, c, partialTicks, true); + RenderUtils.highlightBox(entitySkeleton, c, partialTicks, true); } } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java index 44a9f983..0fb3ac9d 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxSkelemaster.java @@ -45,12 +45,11 @@ public class FeatureBoxSkelemaster extends SimpleFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @DGEventHandler public void drawWorld(RenderWorldLastEvent event) { float partialTicks = event.partialTicks; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; final BlockPos player = Minecraft.getMinecraft().thePlayer.getPosition(); int val = this.<Integer>getParameter("radius").getValue(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java index 6678be5d..e2ac596f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureBoxStarMobs.java @@ -45,12 +45,11 @@ public class FeatureBoxStarMobs extends SimpleFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @DGEventHandler public void drawWorld(RenderWorldLastEvent event) { float partialTicks = event.partialTicks; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; final BlockPos player = Minecraft.getMinecraft().thePlayer.getPosition(); int val = this.<Integer>getParameter("radius").getValue(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java index 486cc966..4a415d99 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonCurrentRoomSecrets.java @@ -41,11 +41,10 @@ public class FeatureDungeonCurrentRoomSecrets extends TextHUDFeature { registerDefaultStyle("totalSecrets", DefaultingDelegatingTextStyle.derive("Feature Default - TotalSecrets", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.TOTAL))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java index 9dc913d0..7fecd926 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonDeaths.java @@ -56,10 +56,9 @@ public class FeatureDungeonDeaths extends TextHUDFeature { registerDefaultStyle("totalDeaths", DefaultingDelegatingTextStyle.derive("Feature Default - TotalDeaths", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - if (!skyblockStatus.isOnDungeon()) return false; + if (!SkyblockStatus.isOnDungeon()) return false; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); return context != null; } @@ -113,7 +112,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature { } public int getTotalDeaths() { - if (!skyblockStatus.isOnDungeon()) return 0; + if (!SkyblockStatus.isOnDungeon()) return 0; for (TabListEntry tabListEntry : TabList.INSTANCE.getTabListEntries()) { String name = tabListEntry.getEffectiveName(); if (name.contains("Deaths")) { @@ -141,7 +140,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature { @DGEventHandler() public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.type == 2) return; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java index eb79509b..cef9e02f 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMap.java @@ -21,6 +21,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; import com.google.common.collect.ComparisonChain; import com.google.common.collect.Ordering; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.chat.ChatTransmitter; import kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3.ParameterItem; import kr.syeyoung.dungeonsguide.mod.config.types.*; @@ -128,7 +129,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { @Override public void drawHUD(float partialTicks) { if (!on) return; - if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null || context.getScaffoldParser() == null) return; @@ -153,7 +154,7 @@ public class FeatureDungeonMap extends RawRenderingGuiFeature { @Override public void drawDemo(float partialTicks) { DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); - if (DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon() && context != null && context.getScaffoldParser() != null && on) { + if (SkyblockStatus.isOnDungeon() && context != null && context.getScaffoldParser() != null && on) { drawHUD(partialTicks); return; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java index 5464afa8..6ef4f714 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonMilestone.java @@ -51,12 +51,11 @@ public class FeatureDungeonMilestone extends TextHUDFeature { registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive("Feature Default - Number", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } @Override @@ -96,7 +95,7 @@ public class FeatureDungeonMilestone extends TextHUDFeature { @DGEventHandler() public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { if (clientChatReceivedEvent.type == 2) return; - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return; String txt = clientChatReceivedEvent.message.getFormattedText(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java index ceeb02f7..cc82aa1e 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRealTime.java @@ -19,6 +19,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonLeftEvent; import kr.syeyoung.dungeonsguide.mod.events.impl.DungeonStartedEvent; @@ -49,7 +50,7 @@ public class FeatureDungeonRealTime extends TextHUDFeature { @Override public boolean isHUDViewable() { - return started != -1; + return started != -1 && SkyblockStatus.isOnDungeon(); } @@ -78,7 +79,7 @@ public class FeatureDungeonRealTime extends TextHUDFeature { started= System.currentTimeMillis(); } - @DGEventHandler(ignoreDisabled = true) + @DGEventHandler(ignoreDisabled = true, triggerOutOfSkyblock = true) public void onDungeonQuit(DungeonLeftEvent event) { started = -1; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java index 3c8e200a..2cf3da4b 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonRoomName.java @@ -41,7 +41,6 @@ public class FeatureDungeonRoomName extends TextHUDFeature { registerDefaultStyle("roomname", DefaultingDelegatingTextStyle.derive("Feature Default - Roomname", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public int getTotalSecretsInt() { DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); @@ -55,7 +54,7 @@ public class FeatureDungeonRoomName extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getScaffoldParser() != null; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getScaffoldParser() != null; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java index fb07d6f4..c194a967 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSBTime.java @@ -37,7 +37,6 @@ import java.util.Collection; public class FeatureDungeonSBTime extends TextHUDFeature { - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public FeatureDungeonSBTime() { super("Dungeon HUD.In Dungeon HUD", "Display Ingame Dungeon Time", "Display how much time skyblock thinks has passed since dungeon run started", "dungeon.stats.igtime"); @@ -74,7 +73,7 @@ public class FeatureDungeonSBTime extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java index f6f5121b..d8df90b6 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonScore.java @@ -65,10 +65,9 @@ public class FeatureDungeonScore extends TextHUDFeature { registerDefaultStyle("required", DefaultingDelegatingTextStyle.derive("Feature Default - Required", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.EXTRA_INFO))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } @Override @@ -196,7 +195,7 @@ public class FeatureDungeonScore extends TextHUDFeature { } public ScoreCalculation calculateScore() { - if (!skyblockStatus.isOnDungeon()) return null; + if (!SkyblockStatus.isOnDungeon()) return null; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if (context == null) return null; if (context.getScaffoldParser() == null) return null; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java index 39a488db..6223087c 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonSecrets.java @@ -47,7 +47,6 @@ public class FeatureDungeonSecrets extends TextHUDFeature { .setTextShader(new AColor(0xFF, 0xFF,0x55,255))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public int getSecretsFound() { for (TabListEntry tabListEntry : TabList.INSTANCE.getTabListEntries()) { String name = tabListEntry.getEffectiveName(); @@ -111,7 +110,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { @Override public boolean isHUDViewable() { - return DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null; + return SkyblockStatus.isOnDungeon() && DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() != null; } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java index ebd134bb..fb521afe 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureDungeonTombs.java @@ -40,7 +40,6 @@ public class FeatureDungeonTombs extends TextHUDFeature { registerDefaultStyle("number", DefaultingDelegatingTextStyle.derive("Feature Default - Number", () -> FeatureRegistry.DEFAULT_STYLE.getStyle(DefaultTextHUDFeatureStyleFeature.Styles.VALUE))); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); public int getTombsFound() { for (TabListEntry tabListEntry : TabList.INSTANCE.getTabListEntries()) { @@ -55,7 +54,7 @@ public class FeatureDungeonTombs extends TextHUDFeature { @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java index 1818e0a7..34dde1bf 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureHideNameTags.java @@ -33,12 +33,11 @@ public class FeatureHideNameTags extends SimpleFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @DGEventHandler public void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent) { - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (renderPlayerEvent.entity instanceof EntityArmorStand) { EntityArmorStand armorStand = (EntityArmorStand) renderPlayerEvent.entity; diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java index cad944be..404414da 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePlayerESP.java @@ -40,8 +40,6 @@ public class FeaturePlayerESP extends SimpleFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - private boolean preCalled = false; @DGEventHandler public void onEntityRenderPre(RenderPlayerEvent.Pre renderPlayerEvent) { diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java index 34d06cfa..24aa9379 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeaturePressAnyKeyToCloseChest.java @@ -20,6 +20,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.dungeon; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.config.types.TCInteger; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; @@ -43,7 +44,7 @@ public class FeaturePressAnyKeyToCloseChest extends SimpleFeature { public void onKeyInput(GuiScreenEvent.KeyboardInputEvent keyboardInputEvent) { GuiScreen screen = Minecraft.getMinecraft().currentScreen; - if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (screen instanceof GuiChest){ ContainerChest ch = (ContainerChest) ((GuiChest)screen).inventorySlots; @@ -67,7 +68,7 @@ public class FeaturePressAnyKeyToCloseChest extends SimpleFeature { public void onMouseInput(GuiScreenEvent.MouseInputEvent.Pre mouseInputEvent) { GuiScreen screen = Minecraft.getMinecraft().currentScreen; - if (!DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (Mouse.getEventButton() == -1) return; if (screen instanceof GuiChest){ diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java index b3336667..7c926845 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWarnLowHealth.java @@ -48,12 +48,11 @@ public class FeatureWarnLowHealth extends TextHUDFeature { } - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return skyblockStatus.isOnDungeon(); + return SkyblockStatus.isOnDungeon(); } @Override diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java index 429d3a87..f4b3946e 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/dungeon/FeatureWatcherWarning.java @@ -42,10 +42,9 @@ public class FeatureWatcherWarning extends TextHUDFeature { setEnabled(false); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return warning > System.currentTimeMillis(); + return warning > System.currentTimeMillis() && SkyblockStatus.isOnDungeon(); } private final UUID lastRoomUID = UUID.randomUUID(); @@ -70,7 +69,7 @@ public class FeatureWatcherWarning extends TextHUDFeature { } } - @DGEventHandler(ignoreDisabled = true) + @DGEventHandler(ignoreDisabled = true, triggerOutOfSkyblock = true) public void onDungeonEnd(DungeonLeftEvent event) { warning = 0; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java index 31d20962..d95dfc00 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureAutoAcceptReparty.java @@ -31,9 +31,6 @@ public class FeatureAutoAcceptReparty extends SimpleFeature { public FeatureAutoAcceptReparty() { super("Dungeon Party.Reparty", "Auto accept reparty", "Automatically accept reparty", "qol.autoacceptreparty", true); } - - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - private String lastDisband; @DGEventHandler(triggerOutOfSkyblock = true) diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java index afe84523..4d019007 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeatureEpicCountdown.java @@ -19,6 +19,7 @@ package kr.syeyoung.dungeonsguide.mod.features.impl.etc; import kr.syeyoung.dungeonsguide.mod.DungeonsGuide; +import kr.syeyoung.dungeonsguide.mod.SkyblockStatus; import kr.syeyoung.dungeonsguide.mod.config.types.TCBoolean; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DGTickEvent; @@ -99,7 +100,7 @@ public class FeatureEpicCountdown extends SimpleFeature { @DGEventHandler public void onTick(DGTickEvent event){ - if(!isEnabled() || !DungeonsGuide.getDungeonsGuide().getSkyblockStatus().isOnDungeon()) return; + if(!isEnabled() || !SkyblockStatus.isOnDungeon()) return; Objective objective = ScoreboardManager.INSTANCE.getSidebarObjective(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java index 4758ab71..3c357287 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/etc/FeaturePenguins.java @@ -91,7 +91,6 @@ public class FeaturePenguins extends SimpleFeature { private Map<String, OBJModel> objModels = new HashMap<>(); - private final SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); private Map<String, IBakedModel> models = new HashMap<>(); @DGEventHandler(ignoreDisabled = true, triggerOutOfSkyblock = true) diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java index 7076bbd8..0c599691 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/FeatureSoulRoomWarning.java @@ -60,10 +60,9 @@ public class FeatureSoulRoomWarning extends TextHUDFeature { .setWidgetGenerator(RoomConfiguration::new)); } - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public boolean isHUDViewable() { - return warning > System.currentTimeMillis(); + return warning > System.currentTimeMillis() && SkyblockStatus.isOnDungeon(); } @@ -79,7 +78,7 @@ public class FeatureSoulRoomWarning extends TextHUDFeature { @DGEventHandler public void onTick(DGTickEvent event) { - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getScaffoldParser() == null) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java index aa04ab09..c7949d10 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/secret/mechanicbrowser/FeatureMechanicBrowse.java @@ -102,8 +102,7 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { @Override public void drawHUD(float partialTicks) { - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getScaffoldParser() == null) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); @@ -141,8 +140,7 @@ public class FeatureMechanicBrowse extends RawRenderingGuiFeature { public void drawWorld(RenderWorldLastEvent event) { float partialTicks = event.partialTicks; - SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); - if (!skyblockStatus.isOnDungeon()) return; + if (!SkyblockStatus.isOnDungeon()) return; if (DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext() == null || DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext().getScaffoldParser() == null) return; DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/richtext/TextHUDFeature.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/richtext/TextHUDFeature.java index bfa4fab5..d0faf0db 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/richtext/TextHUDFeature.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/richtext/TextHUDFeature.java @@ -23,6 +23,7 @@ import kr.syeyoung.dungeonsguide.mod.config.types.TCEnum; import kr.syeyoung.dungeonsguide.mod.config.types.TCRTextStyleMap; import kr.syeyoung.dungeonsguide.mod.events.annotations.DGEventHandler; import kr.syeyoung.dungeonsguide.mod.events.impl.DGTickEvent; +import kr.syeyoung.dungeonsguide.mod.events.impl.SkyblockLeftEvent; import kr.syeyoung.dungeonsguide.mod.features.AbstractHUDFeature; import kr.syeyoung.dungeonsguide.mod.features.FeatureParameter; import kr.syeyoung.dungeonsguide.mod.features.richtext.config.WidgetTextStyleConfig; @@ -79,6 +80,13 @@ public abstract class TextHUDFeature extends AbstractHUDFeature { } } + @DGEventHandler(triggerOutOfSkyblock = true) + public void onSkyblockExit(SkyblockLeftEvent skyblockLeftEvent) { + try { + checkVisibility(); + } catch (Exception e) {} + } + public static FontRenderer getFontRenderer() { return Minecraft.getMinecraft().fontRendererObj; } |