diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-22 00:20:31 +0900 |
---|---|---|
committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-22 00:20:31 +0900 |
commit | 57fa3552e1ebbd39940343a4db12968d5f9931b9 (patch) | |
tree | 53d14e0df6d359464ccc60c0b8f5dac531a747ec /src/main/java | |
parent | 1da5c0fa1b0634b7fd06869ec0de424515025b41 (diff) | |
download | Skyblock-Dungeons-Guide-57fa3552e1ebbd39940343a4db12968d5f9931b9.tar.gz Skyblock-Dungeons-Guide-57fa3552e1ebbd39940343a4db12968d5f9931b9.tar.bz2 Skyblock-Dungeons-Guide-57fa3552e1ebbd39940343a4db12968d5f9931b9.zip |
map analysis base
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/EventListener.java | 1 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java | 31 |
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; } } |