diff options
| author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-25 16:08:17 +0900 |
|---|---|---|
| committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-25 16:08:17 +0900 |
| commit | bfe86d4c79582bb708525ab7b7c433009948d0b8 (patch) | |
| tree | f47072598d7a72976044c3341938c50008c9c053 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder | |
| parent | 81a315f025f361d1155305e55dfee29308a74ed3 (diff) | |
| download | Skyblock-Dungeons-Guide-bfe86d4c79582bb708525ab7b7c433009948d0b8.tar.gz Skyblock-Dungeons-Guide-bfe86d4c79582bb708525ab7b7c433009948d0b8.tar.bz2 Skyblock-Dungeons-Guide-bfe86d4c79582bb708525ab7b7c433009948d0b8.zip | |
asdakjsdk
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder')
| -rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java | 2 | ||||
| -rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java index 7e8c43e0..41e2fb6f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java @@ -108,7 +108,7 @@ public class DungeonRoom { public Block getRelativeBlockAt(int x, int y, int z) { // validate x y z's if (canAccessRelative(x,z)) { - BlockPos pos = new BlockPos(x,y,z).add(min.getX(),0,min.getZ()); + BlockPos pos = new BlockPos(x,y,z).add(min.getX(),min.getZ(),min.getZ()); return this.context.getWorld().getChunkFromBlockCoords(pos).getBlock(pos); } return null; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java index 626b75b4..46337480 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java @@ -51,12 +51,11 @@ public class RoomMatcher { System.out.println("Trying to match "+dungeonRoomInfo.getUuid().toString()+" / "+dungeonRoomInfo.getName()+"... at rotation "+rotation); - int y = dungeonRoom.getMin().getY(); for (int z = 0; z < res.length; z ++) { for (int x = 0; x < res[0].length; x++) { int data = res[z][x]; if (data == -1) continue; - Block b = dungeonRoom.getRelativeBlockAt(x,y,z); + Block b = dungeonRoom.getRelativeBlockAt(x,0,z); if (b == null || Block.getIdFromBlock(b) != data) { System.out.println("Match failed at offset X"+x+" / Z"+z+". expected "+data+" but found "+b +" ("+Block.getIdFromBlock(b)+")"); return false; @@ -74,7 +73,6 @@ public class RoomMatcher { int maxZ = dungeonRoom.getMax().getZ(); int minX = dungeonRoom.getMin().getX(); int minZ = dungeonRoom.getMin().getZ(); - int y = dungeonRoom.getMin().getY(); int widthX = maxX - minX + 2; int heightZ = maxZ - minZ + 2; int[][] data = new int[dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() +2][dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 2]; @@ -90,7 +88,7 @@ public class RoomMatcher { continue; } - Block b = dungeonRoom.getRelativeBlockAt(x,y,z); + Block b = dungeonRoom.getRelativeBlockAt(x,0,z); if (b == null) { data[z][x] = -1; } else { |
