diff options
author | Eryk Ruta <70776766+kingstefan26@users.noreply.github.com> | 2022-11-06 23:27:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 07:27:27 +0900 |
commit | a51fda82aec96fbb1597e04e9919caaef500c2eb (patch) | |
tree | 00e68f253a6874595f738df85ebf2b5c2dd678d1 | |
parent | f4a01fb049ec8f50462ef0d7fb3ce15b670b311f (diff) | |
download | Skyblock-Dungeons-Guide-a51fda82aec96fbb1597e04e9919caaef500c2eb.tar.gz Skyblock-Dungeons-Guide-a51fda82aec96fbb1597e04e9919caaef500c2eb.tar.bz2 Skyblock-Dungeons-Guide-a51fda82aec96fbb1597e04e9919caaef500c2eb.zip |
added null check for latest map data (#76)
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java index 9c2462ea..6ae4b5c2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/MapProcessor.java @@ -119,7 +119,7 @@ public class MapProcessor { if (mapData != null) { if(processMapThroddle > 5 && !processlock){ - processMapData(mapData.colors); + processMapData(mapData); processMapThroddle = 0; } processMapThroddle++; @@ -134,10 +134,11 @@ public class MapProcessor { } - private void processMapData(byte[] mapColorData) { + private void processMapData(MapData mapData) { + byte[] mapColorData = mapData.colors; // i just cant get this to work sad - if (isThereDifference(latestMapData.colors, mapColorData)) { + if (isThereDifference(latestMapData, mapColorData)) { context.createEvent(new DungeonMapUpdateEvent(mapColorData)); es.execute(() -> { @@ -403,7 +404,12 @@ public class MapProcessor { return unit1 == unit2 && unit2 == unit3 && unit1 != 0; } - public boolean isThereDifference(byte[] colorData, byte[] colorData1) { + public boolean isThereDifference(MapData latestMapData, byte[] colorData1) { + byte[] colorData = null; + + if(latestMapData != null){ + colorData = latestMapData.colors; + } return true; // boolean equals = Arrays.equals(colorData1, colorData); |