aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-06 15:02:55 +0900
committersyeyoung <cyong06@naver.com>2021-02-06 15:02:55 +0900
commit00ff33e33ee694845697f807760282c0ee22f3e5 (patch)
tree26b2160598de57aee0d1982c7e0172409b199342 /src/main/java/kr/syeyoung/dungeonsguide/features
parente7d6517b2e1fb4aa7a5993e53739006a3fca39c8 (diff)
downloadSkyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.tar.gz
Skyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.tar.bz2
Skyblock-Dungeons-Guide-00ff33e33ee694845697f807760282c0ee22f3e5.zip
Bettuh cooldown and message
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java17
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
index febb5e59..3db76f1d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java
@@ -60,6 +60,7 @@ public class FeatureRegistry {
public static final FeatureTooltipDungeonStat ETC_DUNGEONSTAT = register(new FeatureTooltipDungeonStat());
public static final FeatureTooltipPrice ETC_PRICE = register(new FeatureTooltipPrice());
public static final FeatureCooldownCounter ETC_COOLDOWN = register(new FeatureCooldownCounter());
+ public static final SimpleFeature ETC_REMOVE_REPARTY = register(new SimpleFeature("ETC", "Remove Reparty Command From DG", "/rp will still work, Auto reparty will still work\nRequires Restart to get applied", "qol.noreparty"));
public static final SimpleFeature FIX_SPIRIT_BOOTS = register(new SimpleFeature("fixes", "Spirit Boots Fixer", "Fix Spirit boots messing up with inventory", "fixes.spirit", true));
public static final FeatureDisableMessage FIX_MESSAGES = register(new FeatureDisableMessage());
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java
index 6547196c..ddad792e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureCooldownCounter.java
@@ -5,15 +5,19 @@ 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.GuiOpenListener;
import kr.syeyoung.dungeonsguide.features.listener.TickListener;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.inventory.ContainerChest;
+import net.minecraftforge.client.event.GuiOpenEvent;
import org.lwjgl.opengl.GL11;
import java.awt.*;
-public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitListener {
+public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitListener, GuiOpenListener {
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"));
@@ -44,4 +48,15 @@ public class FeatureCooldownCounter extends GuiFeature implements DungeonQuitLis
public void onDungeonQuit() {
leftDungeonTime = System.currentTimeMillis();
}
+
+ @Override
+ public void onGuiOpen(GuiOpenEvent rendered) {
+ if (!(rendered.gui instanceof GuiChest)) return;
+ ContainerChest chest = (ContainerChest) ((GuiChest) rendered.gui).inventorySlots;
+ if (chest.getLowerChestInventory().getName().contains("On Cooldown!")) {
+ leftDungeonTime = System.currentTimeMillis();
+ } else if (chest.getLowerChestInventory().getName().contains("Error")) {
+ leftDungeonTime = System.currentTimeMillis();
+ }
+ }
}