aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder
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/dungeon/roomfinder
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/dungeon/roomfinder')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java5
1 files changed, 2 insertions, 3 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 c68cb511..00b81f59 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java
@@ -94,13 +94,13 @@ public class DungeonRoom {
this.currentState = currentState;
}
- public ScheduledFuture<List<Vec3>> createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist) {
+ public ScheduledFuture<List<Vec3>> createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist, int timeout) {
if (FeatureRegistry.SECRET_PATHFIND_STRATEGY.isEnabled()) {
ScheduledFuture<List<Vec3>> sf = asyncPathFinder.schedule(() -> {
BlockPos min = new BlockPos(getMin().getX(), 0, getMin().getZ());
BlockPos max= new BlockPos(getMax().getX(), 255, getMax().getZ());
JPSPathfinder pathFinder = new JPSPathfinder(context.getWorld(), min, max);
- pathFinder.pathfind(entityIn.getPositionVector(), new Vec3(targetPos).addVector(0.5, 0.5, 0.5), 1.5f,1000);
+ pathFinder.pathfind(entityIn.getPositionVector(), new Vec3(targetPos).addVector(0.5, 0.5, 0.5), 1.5f,timeout);
return pathFinder.getRoute();
}, 0, TimeUnit.MILLISECONDS);
return sf;
@@ -118,7 +118,6 @@ public class DungeonRoom {
}
return new ArrayList<>();
}, 0, TimeUnit.MILLISECONDS);
- asyncPathFinder.schedule(() -> sf.cancel(true), 10, TimeUnit.SECONDS);
return sf;
}
}