diff options
author | syeyoung <cyong06@naver.com> | 2021-02-06 15:02:55 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-06 15:02:55 +0900 |
commit | 00ff33e33ee694845697f807760282c0ee22f3e5 (patch) | |
tree | 26b2160598de57aee0d1982c7e0172409b199342 /src/main/java/kr/syeyoung/dungeonsguide/features/impl | |
parent | e7d6517b2e1fb4aa7a5993e53739006a3fca39c8 (diff) | |
download | Skyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.tar.gz Skyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.tar.bz2 Skyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.zip |
Bettuh cooldown and message
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java index 6547196c..ddad792e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java @@ -5,15 +5,19 @@ import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.GuiFeature; import kr.syeyoung.dungeonsguide.features.listener.DungeonQuitListener; +import kr.syeyoung.dungeonsguide.features.listener.GuiOpenListener; import kr.syeyoung.dungeonsguide.features.listener.TickListener; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.ContainerChest; +import net.minecraftforge.client.event.GuiOpenEvent; import org.lwjgl.opengl.GL11; import java.awt.*; -public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitListener { +public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitListener, GuiOpenListener { public FeatureCooldownCounter() { super("ETC", "Dungeon Cooldown Counter", "Counts 10 seconds after leaving dungeon", "qol.cooldown", true, getFontRenderer().getStringWidth("Cooldown: 10s "), getFontRenderer().FONT_HEIGHT); parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.white, "color")); @@ -44,4 +48,15 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis public void onDungeonQuit() { leftDungeonTime = System.currentTimeMillis(); } + + @Override + public void onGuiOpen(GuiOpenEvent rendered) { + if (!(rendered.gui instanceof GuiChest)) return; + ContainerChest chest = (ContainerChest) ((GuiChest) rendered.gui).inventorySlots; + if (chest.getLowerChestInventory().getName().contains("On Cooldown!")) { + leftDungeonTime = System.currentTimeMillis(); + } else if (chest.getLowerChestInventory().getName().contains("Error")) { + leftDungeonTime = System.currentTimeMillis(); + } + } } |