diff --git a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch index f9f3da00b..2882c1bc3 100644 --- a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch +++ b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch @@ -18,7 +18,7 @@ index c76087614..475c93836 100644 } diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 6ce35018a..2a391be28 100644 +index 7b27251b3..fe19167a1 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { diff --git a/Spigot-Server-Patches/EntityPathfindEvent.patch b/Spigot-Server-Patches/EntityPathfindEvent.patch index 296035afd..6817b68ce 100644 --- a/Spigot-Server-Patches/EntityPathfindEvent.patch +++ b/Spigot-Server-Patches/EntityPathfindEvent.patch @@ -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; diff --git a/Spigot-Server-Patches/Mob-Pathfinding-API.patch b/Spigot-Server-Patches/Mob-Pathfinding-API.patch index 7d8751c08..3a14d3994 100644 --- a/Spigot-Server-Patches/Mob-Pathfinding-API.patch +++ b/Spigot-Server-Patches/Mob-Pathfinding-API.patch @@ -123,7 +123,7 @@ index 000000000..f68a07cb9 + } +} diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 0586597e7..583f2c5ad 100644 +index 6a1d5a899..f6a5aa27b 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { diff --git a/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch index 8a6863603..0144fcc16 100644 --- a/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 2a391be28a..0586597e73 100644 +index fe19167a1..6a1d5a899 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { - @Nullable - protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) { + @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, Entity target, double d0, double d1, double d2, int i, boolean flag) { // Paper end + if (!getEntity().getWorld().getWorldBorder().isInBounds(blockposition)) return null; // Paper - don't path out of world border if (!this.a()) {