Review EntityPathfindEvent
Add missing target forward
This commit is contained in:
@@ -5,8 +5,21 @@ Subject: [PATCH] EntityPathfindEvent
|
||||
|
||||
Fires when an Entity decides to start moving to a location.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java
|
||||
index 79b2d9297..b6e3bf823 100644
|
||||
--- a/src/main/java/net/minecraft/server/Navigation.java
|
||||
+++ b/src/main/java/net/minecraft/server/Navigation.java
|
||||
@@ -0,0 +0,0 @@ public class Navigation extends NavigationAbstract {
|
||||
|
||||
@Override
|
||||
public PathEntity a(Entity entity) {
|
||||
- return this.b(new BlockPosition(entity));
|
||||
+ return this.b(new BlockPosition(entity), entity); // Paper - Forward target entity
|
||||
}
|
||||
|
||||
private int s() {
|
||||
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
index 2ced8dedd..6ce35018a 100644
|
||||
index 2ced8dedd..7b27251b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
@@ -22,11 +35,11 @@ index 2ced8dedd..6ce35018a 100644
|
||||
return this.b(new BlockPosition(d0, d1, d2));
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public PathEntity b(BlockPosition blockposition) {
|
||||
+ // Paper start - Add target entity parameter for path find event
|
||||
+ @Nullable public PathEntity b(BlockPosition blockposition) { return this.b(blockposition, null); }
|
||||
@Nullable
|
||||
- public PathEntity b(BlockPosition blockposition) {
|
||||
+ public PathEntity b(BlockPosition blockposition, Entity target) {
|
||||
+ @Nullable public PathEntity b(BlockPosition blockposition, Entity target) {
|
||||
+ // Paper end
|
||||
float f = (float) blockposition.getX() + 0.5F;
|
||||
float f1 = (float) blockposition.getY() + 0.5F;
|
||||
@@ -45,11 +58,11 @@ index 2ced8dedd..6ce35018a 100644
|
||||
+ return this.a(blockposition, entity, d0, d1, d2, 16, true); // Paper - Path find event
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) {
|
||||
+ // Paper start - Add target entity parameter for path find event
|
||||
+ @Nullable protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) { return this.a(blockposition, null, d0, d1, d2, i, flag); }
|
||||
@Nullable
|
||||
- protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) {
|
||||
+ protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) {
|
||||
+ @Nullable protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) {
|
||||
+ // Paper end
|
||||
if (!this.a()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user