aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-21 23:22:54 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-21 23:22:54 +0900
commit94a710964f164873a7238abb2e094d179deb331b (patch)
tree22c34da93f055c59937112dbcfa7613708fb5305 /src/main/java/kr/syeyoung/dungeonsguide
parentf8c19203b0e3df1a1603996f7695fd06b17de4d9 (diff)
downloadSkyblock-Dungeons-Guide-94a710964f164873a7238abb2e094d179deb331b.tar.gz
Skyblock-Dungeons-Guide-94a710964f164873a7238abb2e094d179deb331b.tar.bz2
Skyblock-Dungeons-Guide-94a710964f164873a7238abb2e094d179deb331b.zip
Dungeon Context
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/EventListener.java9
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java8
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java17
3 files changed, 33 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
index 68e55147..071cc6d5 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
@@ -1,5 +1,7 @@
package kr.syeyoung.dungeonsguide;
+import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
+import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
@@ -10,7 +12,12 @@ public class EventListener {
if (e.phase == TickEvent.Phase.START) {
timerTick ++;
if (timerTick % 5 == 0) {
- DungeonsGuide.getDungeonsGuide().getSkyblockStatus().updateStatus();
+ SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus();
+ boolean isOnDungeon = skyblockStatus.isOnDungeon();
+ skyblockStatus.updateStatus();
+ if (!skyblockStatus.isOnDungeon()) return;
+ if (isOnDungeon) skyblockStatus.getContext().tick();
+ else skyblockStatus.setContext(new DungeonContext(Minecraft.getMinecraft().thePlayer.worldObj));
}
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
index 45bac7e2..bb7c0a99 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
@@ -1,8 +1,10 @@
package kr.syeyoung.dungeonsguide;
import com.google.common.collect.Sets;
+import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
import kr.syeyoung.dungeonsguide.utils.TextUtils;
import lombok.Getter;
+import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.scoreboard.*;
@@ -17,8 +19,14 @@ public class SkyblockStatus {
@Getter
private boolean isOnDungeon;
+ @Getter
+ @Setter
+ private DungeonContext context;
+
private final Pattern SERVER_BRAND_PATTERN = Pattern.compile("(.+) <- (?:.+)");
+
+
public boolean isOnHypixel() {
Minecraft mc = Minecraft.getMinecraft();
if (mc == null || mc.thePlayer == null) return false;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
new file mode 100644
index 00000000..b7592eb8
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
@@ -0,0 +1,17 @@
+package kr.syeyoung.dungeonsguide.dungeon;
+
+import lombok.Getter;
+import net.minecraft.world.World;
+
+public class DungeonContext {
+ @Getter
+ private World world;
+
+ public DungeonContext(World world) {
+ this.world = world;
+ }
+
+ public void tick() {
+
+ }
+}