aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/EventListener.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java31
2 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
index 2700b6bf..d80a474d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
@@ -14,6 +14,7 @@ public class EventListener {
if (timerTick % 5 == 0) {
SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus();
boolean isOnDungeon = skyblockStatus.isOnDungeon();
+// System.out.println(isOnDungeon);
skyblockStatus.updateStatus();
if (!skyblockStatus.isOnDungeon()) {
skyblockStatus.setContext(null);
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
index b7592eb8..104225f3 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
@@ -1,17 +1,48 @@
package kr.syeyoung.dungeonsguide.dungeon;
import lombok.Getter;
+import net.minecraft.client.Minecraft;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemMap;
+import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
+import net.minecraft.world.storage.MapData;
public class DungeonContext {
@Getter
private World world;
+ private byte[] lastMapData;
+
public DungeonContext(World world) {
this.world = world;
}
+
public void tick() {
+ mapTick();
+ }
+
+ private void buildMap(byte[] mapData) {
+
+ }
+ private void processMap(byte[] mapData) {
+
+ }
+
+ private void mapTick() {
+ ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(8);
+ byte[] mapData;
+ if (stack == null || !(stack.getItem() instanceof ItemMap)) {
+ mapData = lastMapData;
+ } else {
+ MapData mapData1 = ((ItemMap)stack.getItem()).getMapData(stack, world);
+ mapData = mapData1.colors;
+ }
+
+ if (lastMapData == null && mapData != null) buildMap(mapData);
+ processMap(mapData);
+ lastMapData = mapData;
}
}