aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-02 00:09:42 +0900
committersyeyoung <cyong06@naver.com>2021-01-02 00:09:42 +0900
commit997220275d9164271d3ceb636e90f18913038912 (patch)
treefceba903429569fe23c360a3c4e1be337c178561 /src/main/java/kr/syeyoung/dungeonsguide/features
parent43ca7d03db3f75e1820138fb269a7b6ee5b95f08 (diff)
downloadSkyblock-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/features')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java16
1 files changed, 14 insertions, 2 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 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();
}
}