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/FeatureDungeonRealTime.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/FeatureDungeonRealTime.java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonRealTime.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonRealTime.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonRealTime.java index 9b2620e4..eef21539 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonRealTime.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonRealTime.java @@ -5,6 +5,8 @@ import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.GuiFeature; import kr.syeyoung.dungeonsguide.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; +import kr.syeyoung.dungeonsguide.features.listener.DungeonStartListener; import kr.syeyoung.dungeonsguide.features.listener.TickListener; import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.client.gui.FontRenderer; @@ -14,7 +16,7 @@ import org.lwjgl.opengl.GL11; import java.awt.*; import java.text.SimpleDateFormat; -public class FeatureDungeonRealTime extends GuiFeature implements TickListener { +public class FeatureDungeonRealTime extends GuiFeature implements DungeonStartListener, DungeonEndListener { public FeatureDungeonRealTime() { super("Dungeon", "Display Real Time-Dungeon Time", "Display how much real time has passed since dungeon run started", "dungeon.stats.realtime", true, getFontRenderer().getStringWidth("Time(Real): 59m 59s"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); @@ -43,15 +45,13 @@ public class FeatureDungeonRealTime extends GuiFeature implements TickListener { fr.drawString("Time(Real): -42h", 0,0, this.<Color>getParameter("color").getValue().getRGB()); } - SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); - private boolean wasInDungeon = false; @Override - public void onTick() { - if (wasInDungeon && !skyblockStatus.isOnDungeon()) { - if (skyblockStatus.isOnSkyblock()) started = -1; - } else if (!wasInDungeon && skyblockStatus.isOnDungeon()) { - started = System.currentTimeMillis(); - } - wasInDungeon = skyblockStatus.isOnDungeon(); + public void onDungeonEnd() { + started = -1; + } + + @Override + public void onDungeonStart() { + started= System.currentTimeMillis(); } } |