diff options
author | syeyoung <cyong06@naver.com> | 2021-01-08 13:40:43 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-08 13:40:43 +0900 |
commit | b382461db0b5fb96271bf548fa5aa89f0981ae05 (patch) | |
tree | e44c9db526292f70679103b7a8b13db6198f2d08 /src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java | |
parent | a248c240b2d8164453ac2269e71bd64ce26ae373 (diff) | |
download | Skyblock-Dungeons-Guide-b382461db0b5fb96271bf548fa5aa89f0981ae05.tar.gz Skyblock-Dungeons-Guide-b382461db0b5fb96271bf548fa5aa89f0981ae05.tar.bz2 Skyblock-Dungeons-Guide-b382461db0b5fb96271bf548fa5aa89f0981ae05.zip |
new eventos
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java index 17efd2e8..56ff4ce7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java @@ -4,6 +4,7 @@ import kr.syeyoung.dungeonsguide.SkyblockStatus; 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.TickListener; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -11,7 +12,7 @@ import org.lwjgl.opengl.GL11; import java.awt.*; -public class FeatureCooldownCounter extends GuiFeature implements TickListener { +public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitListener { 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")); @@ -21,11 +22,11 @@ public class FeatureCooldownCounter extends GuiFeature implements TickListener { private boolean wasInDungeon = false; @Override public void drawHUD(float partialTicks) { - if (System.currentTimeMillis() - leftDungeonTime > 10000) return; + if (System.currentTimeMillis() - leftDungeonTime > 20000) return; FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; GL11.glScaled(scale, scale, 0); - fr.drawString("Cooldown: "+(10 - (System.currentTimeMillis() - leftDungeonTime) / 1000)+"s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Cooldown: "+(20 - (System.currentTimeMillis() - leftDungeonTime) / 1000)+"s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } @Override @@ -33,17 +34,13 @@ public class FeatureCooldownCounter extends GuiFeature implements TickListener { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; GL11.glScaled(scale, scale, 0); - fr.drawString("Cooldown: 10s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Cooldown: 20s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + @Override - public void onTick() { - if (wasInDungeon && !skyblockStatus.isOnDungeon()) { - if (skyblockStatus.isOnSkyblock()) - leftDungeonTime = System.currentTimeMillis(); - else return; - } - wasInDungeon = skyblockStatus.isOnDungeon(); + public void onDungeonQuit() { + leftDungeonTime = System.currentTimeMillis(); } } |