Expose canReach to mob pathfinding API (#10636)

This commit is contained in:
SoSeDiK 2024-05-01 13:00:11 +03:00 committed by GitHub
parent 3e0eb4a1ba
commit 4cfd9e25fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View file

@ -12,10 +12,10 @@ 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
new file mode 100644
index 0000000000000000000000000000000000000000..064712e7b27a200b29c72076a82f4f5611fa507f
index 0000000000000000000000000000000000000000..3dbe4cf29a7984a1976a60bdeeb3ede02316a3cb
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java
@@ -0,0 +1,143 @@
@@ -0,0 +1,148 @@
+package com.destroystokyo.paper.entity;
+
+import org.apache.commons.lang.Validate;
@ -132,6 +132,11 @@ index 0000000000000000000000000000000000000000..064712e7b27a200b29c72076a82f4f56
+ }
+
+ @Override
+ public boolean canReachFinalPoint() {
+ return path.canReach();
+ }
+
+ @Override
+ public List<Location> getPoints() {
+ List<Location> points = new ArrayList<>();
+ for (Node point : path.nodes) {