diff options
author | syeyoung <cyong06@naver.com> | 2021-01-02 00:09:42 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-02 00:09:42 +0900 |
commit | 997220275d9164271d3ceb636e90f18913038912 (patch) | |
tree | fceba903429569fe23c360a3c4e1be337c178561 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | 43ca7d03db3f75e1820138fb269a7b6ee5b95f08 (diff) | |
download | Skyblock-Dungeons-Guide-997220275d9164271d3ceb636e90f18913038912.tar.gz Skyblock-Dungeons-Guide-997220275d9164271d3ceb636e90f18913038912.tar.bz2 Skyblock-Dungeons-Guide-997220275d9164271d3ceb636e90f18913038912.zip |
cooldown!
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
3 files changed, 21 insertions, 8 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/e.java b/src/main/java/kr/syeyoung/dungeonsguide/e.java index 8e5bb478..1d7f78f7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/e.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/e.java @@ -47,11 +47,6 @@ public class e implements c { public void init(FMLInitializationEvent event) { - try { - Config.loadConfig( null ); - } catch (IOException e) { - e.printStackTrace(); - } dungeonsGuide = this; skyblockStatus = new SkyblockStatus(); @@ -83,6 +78,12 @@ public class e implements c { } Keybinds.register(); + + try { + Config.loadConfig( null ); + } catch (IOException e) { + e.printStackTrace(); + } } public void pre(FMLPreInitializationEvent event) { configDir = new File(event.getModConfigurationDirectory(),"dungeonsguide"); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java index 4bf332c8..362e1ae8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java @@ -82,7 +82,7 @@ public class FeatureListener { @SubscribeEvent public void onTick(TickEvent.ClientTickEvent tick) { - if (tick.phase == TickEvent.Phase.END && tick.type == TickEvent.Type.PLAYER ) { + if (tick.phase == TickEvent.Phase.END && tick.type == TickEvent.Type.CLIENT ) { try { SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); if (!skyblockStatus.isOnSkyblock()) return; 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 76a942a2..6b79487d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java @@ -1,5 +1,7 @@ package kr.syeyoung.dungeonsguide.features.impl; +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.TickListener; @@ -15,12 +17,15 @@ public class FeatureCooldownCounter extends GuiFeature implements TickListener { parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.white, "color")); } + private long leftDungeonTime = 0L; + private boolean wasInDungeon = false; @Override public void drawHUD(float partialTicks) { + if (System.currentTimeMillis() - leftDungeonTime > 10000) return; FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; GL11.glScaled(scale, scale, 0); - fr.drawString("Cooldown: 1s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); + fr.drawString("Cooldown: "+(10 - (System.currentTimeMillis() - leftDungeonTime) / 1000)+"s", 0,0,this.<Color>getParameter("color").getValue().getRGB()); } @Override @@ -31,8 +36,15 @@ public class FeatureCooldownCounter extends GuiFeature implements TickListener { fr.drawString("Cooldown: 10s", 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; + System.out.println("think he left"); + } + wasInDungeon = skyblockStatus.isOnDungeon(); } } |