1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-31 03:50:36 +01:00

Pathfinder hasPath should check if path is done. ()

This commit is contained in:
Roman Alexander 2023-07-23 03:04:19 +07:00
parent 2eb935ac55
commit 502e9950bf

View file

@ -54,14 +54,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public boolean hasPath() {
+ return entity.getNavigation().getPath() != null;
+ return entity.getNavigation().getPath() != null && !entity.getNavigation().getPath().isDone();
+ }
+
+ @Nullable
+ @Override
+ public PathResult getCurrentPath() {
+ Path path = entity.getNavigation().getPath();
+ return path != null ? new PaperPathResult(path) : null;
+ return path != null && !path.isDone() ? new PaperPathResult(path) : null;
+ }
+
+ @Nullable