mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 20:16:19 +01:00
Pathfinder hasPath should check if path is done. (#9231)
This commit is contained in:
parent
b1334b5105
commit
2f8d9db58c
@ -12,7 +12,7 @@ public net.minecraft.world.level.pathfinder.Path nodes
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..7ba7add6475ff8d238897398c26de24de52c4cfd
|
index 0000000000000000000000000000000000000000..064712e7b27a200b29c72076a82f4f5611fa507f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
|
||||||
@@ -0,0 +1,143 @@
|
@@ -0,0 +1,143 @@
|
||||||
@ -54,14 +54,14 @@ index 0000000000000000000000000000000000000000..7ba7add6475ff8d238897398c26de24d
|
|||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean hasPath() {
|
+ public boolean hasPath() {
|
||||||
+ return entity.getNavigation().getPath() != null;
|
+ return entity.getNavigation().getPath() != null && !entity.getNavigation().getPath().isDone();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Nullable
|
+ @Nullable
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public PathResult getCurrentPath() {
|
+ public PathResult getCurrentPath() {
|
||||||
+ Path path = entity.getNavigation().getPath();
|
+ Path path = entity.getNavigation().getPath();
|
||||||
+ return path != null ? new PaperPathResult(path) : null;
|
+ return path != null && !path.isDone() ? new PaperPathResult(path) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Nullable
|
+ @Nullable
|
||||||
|
Loading…
Reference in New Issue
Block a user