From d72f7f1db99b76385073995ed0b193b7ed5361c0 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 28 Feb 2021 22:21:58 +0900 Subject: iron bars --- .../pathfinding/NodeProcessorDungeonRoom.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java index 8955a765..8e937b34 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java @@ -77,6 +77,34 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { } } } + + if (dir.getY() == 0 && curr.getBlock() == Blocks.iron_bars && up.getBlock() == Blocks.air && + entityIn.getEntityWorld().getBlockState(new BlockPos(currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord)).getBlock() != Blocks.iron_bars) { + boolean theFlag = false; + if (newX == 0) { + if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) + .add(0,0,1)).getBlock() == Blocks.air) { + theFlag = true; + } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) + .add(0,0,-1)).getBlock() == Blocks.air) { + theFlag = true; + } + } else if (newZ == 0) { + if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) + .add(-1,0,0)).getBlock() == Blocks.air) { + theFlag = true; + } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ) + .add(1,0,0)).getBlock() == Blocks.air) { + theFlag = true; + } + } + if (theFlag) { + PathPoint pt = openPoint(newX, newY, newZ); + if (pt.visited) continue; + pathOptions[i++] = pt; + continue; + } + } } return i; } -- cgit