aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-08 13:40:43 +0900
committersyeyoung <cyong06@naver.com>2021-01-08 13:40:43 +0900
commitb382461db0b5fb96271bf548fa5aa89f0981ae05 (patch)
treee44c9db526292f70679103b7a8b13db6198f2d08 /src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java
parenta248c240b2d8164453ac2269e71bd64ce26ae373 (diff)
downloadSkyblock-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/FeatureDungeonSBTime.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java
index 65f06f58..88236758 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonSBTime.java
@@ -2,10 +2,10 @@ package kr.syeyoung.dungeonsguide.features.impl;
import kr.syeyoung.dungeonsguide.SkyblockStatus;
import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.events.DungeonEndedEvent;
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.TickListener;
+import kr.syeyoung.dungeonsguide.features.listener.*;
import kr.syeyoung.dungeonsguide.utils.TextUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
@@ -19,24 +19,25 @@ import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.Collection;
-public class FeatureDungeonSBTime extends GuiFeature implements TickListener {
+public class FeatureDungeonSBTime extends GuiFeature {
+
+ private SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+
public FeatureDungeonSBTime() {
super("Dungeon", "Display Ingame Dungeon Time", "Display how much time skyblock thinks has passed since dungeon run started", "dungeon.stats.igtime", true, getFontRenderer().getStringWidth("Time(IG): 1h 59m 59s"), getFontRenderer().FONT_HEIGHT);
this.setEnabled(false);
parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.orange, "color"));
}
-
- private long started = -1;
@Override
public void drawHUD(float partialTicks) {
- if (started == -1) return;
+ if (!skyblockStatus.isOnDungeon()) return;
FontRenderer fr = getFontRenderer();
double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT;
GL11.glScaled(scale, scale, 0);
Scoreboard scoreboard = Minecraft.getMinecraft().theWorld.getScoreboard();
ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1);
Collection<Score> scores = scoreboard.getSortedScores(objective);
- String time = "idkyet";
+ String time = "unknown";
for (Score sc:scores) {
ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(sc.getPlayerName());
String strippedLine = TextUtils.keepScoreboardCharacters(TextUtils.stripColor(ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()))).trim();
@@ -77,16 +78,4 @@ public class FeatureDungeonSBTime extends GuiFeature implements TickListener {
fr.drawString("Time(Ig): -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();
- }
}