diff options
author | syeyoung <cyong06@naver.com> | 2021-02-17 20:34:19 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-17 20:34:19 +0900 |
commit | abce348d7a8becd975d2bc753f7c11d5fa5c1024 (patch) | |
tree | fc096577ce8fe0a8815567a68be4bc32a4711197 /src/main/java/kr/syeyoung/dungeonsguide/pathfinding | |
parent | 85dbbd16cc89f3179eb99c70ea4e007814e7c529 (diff) | |
download | Skyblock-Dungeons-Guide-abce348d7a8becd975d2bc753f7c11d5fa5c1024.tar.gz Skyblock-Dungeons-Guide-abce348d7a8becd975d2bc753f7c11d5fa5c1024.tar.bz2 Skyblock-Dungeons-Guide-abce348d7a8becd975d2bc753f7c11d5fa5c1024.zip |
bruh
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/pathfinding')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java index dcea61ca..256673ba 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java @@ -52,11 +52,30 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { int newZ = currentPoint.zCoord + dir.getZ(); if (newX < 0 || newZ < 0) continue; if (newX > sub.getX()|| newZ > sub.getZ()) continue; - if (isValidBlock(entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ))) - && isValidBlock( entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY + 1, newZ)))) { + IBlockState curr = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)); + IBlockState up = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY + 1, newZ)); + if (isValidBlock(curr) + && isValidBlock(up )) { PathPoint pt = openPoint(newX, newY, newZ); if (pt.visited) continue; pathOptions[i++] = pt; + continue; + } + + if (curr.getBlock() == Blocks.air) { + if (up.getBlock() == Blocks.stone_slab + || up.getBlock() == Blocks.wooden_slab + || up.getBlock() == Blocks.stone_slab2) { + IBlockState up2 = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY -1, newZ)); + if (up2.getBlock() == Blocks.stone_slab + || up2.getBlock() == Blocks.wooden_slab + || up2.getBlock() == Blocks.stone_slab2) { + PathPoint pt = openPoint(newX, newY, newZ); + if (pt.visited) continue; + pathOptions[i++] = pt; + continue; + } + } } } return i; @@ -69,7 +88,7 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { || state.getBlock() == Blocks.standing_sign || state.getBlock() == Blocks.wall_sign || state.getBlock() == Blocks.trapdoor || state.getBlock() == Blocks.iron_trapdoor || state.getBlock() == Blocks.wooden_button || state.getBlock() == Blocks.stone_button - || state.getBlock() == Blocks.fire + || state.getBlock() == Blocks.fire || state.getBlock() == Blocks.torch || (state == Blocks.stone.getStateFromMeta(2)); } } |