aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/pathfinding
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2021-10-02 15:30:51 +0900
committersyeyoung <cyoung06@naver.com>2021-10-02 15:33:33 +0900
commitf818e42c6c21ed6b2d7993dca87e6cd52f3d5251 (patch)
tree250f7979a82e146b61bcbcc2f4d9fd6b57bee911 /src/main/java/kr/syeyoung/dungeonsguide/pathfinding
parent07f74480447495e6cd42237e4740fb082cb4b821 (diff)
downloadSkyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.gz
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.bz2
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.zip
Line Properties for each pathfind context
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/pathfinding')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java
index b824c731..3d3e5f2a 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/JPSPathfinder.java
@@ -24,6 +24,7 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
+import net.minecraft.init.Blocks;
import net.minecraft.util.*;
import net.minecraft.world.ChunkCache;
import net.minecraft.world.World;
@@ -127,7 +128,7 @@ public class JPSPathfinder {
Node end = null; float minDist = Float.MAX_VALUE;
long forceEnd = System.currentTimeMillis() + timeout;
while(!open.isEmpty()) {
- if (forceEnd < System.currentTimeMillis()) break;
+ if (forceEnd < System.currentTimeMillis() && timeout != -1) break;
Node n = open.poll();
n.closed= true;
if (minDist > n.h) {
@@ -323,7 +324,7 @@ public class JPSPathfinder {
Block b = iblockstate1.getBlock();
if (!b.getMaterial().blocksMovement())continue;
if (b.isFullCube() && i2 == k-1) continue;
- if (b.isFullCube()) {
+ if (b.isFullCube() && !iblockstate1.equals( NodeProcessorDungeonRoom.preBuilt)) {
theBit |= (3L << bitStart);
arr[location] = theBit;
return true;