From fd84aa5c42e1491170f7d29cba7ada3078cc341e Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 12 Sep 2018 21:17:59 -0400 Subject: [PATCH] Fix pathfinding NPE - Fixes #1435 --- ...revent-pathfinding-from-loading-chunks.patch | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/0367-Prevent-pathfinding-from-loading-chunks.patch b/Spigot-Server-Patches/0367-Prevent-pathfinding-from-loading-chunks.patch index f6eef958d7..05dd2f9c9d 100644 --- a/Spigot-Server-Patches/0367-Prevent-pathfinding-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0367-Prevent-pathfinding-from-loading-chunks.patch @@ -1,29 +1,38 @@ -From efe00b392d2d7c0ce533572ff47bd7a27cbb2d57 Mon Sep 17 00:00:00 2001 +From 89178baf536b0d8aaa0e0cb18e96101509ce62a3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 10 Sep 2018 23:52:28 -0400 Subject: [PATCH] Prevent pathfinding from loading chunks diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 4023253f42..b2480301ef 100644 +index 4023253f42..113fd9a50f 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -21,13 +21,14 @@ public abstract class NavigationAbstract { +@@ -21,13 +21,15 @@ public abstract class NavigationAbstract { protected long n; protected PathfinderAbstract o; private BlockPosition q; - private Pathfinder r; + private Pathfinder r; public Pathfinder getPathfinder() { return r; } // Paper - OBFHELPER ++ private void setWorld() { if (getPathfinder() != null && getPathfinder().getPathfinder() != null) getPathfinder().getPathfinder().world = getEntity().world; } // Paper public NavigationAbstract(EntityInsentient entityinsentient, World world) { this.a = entityinsentient; this.b = world; this.p = entityinsentient.getAttributeInstance(GenericAttributes.FOLLOW_RANGE); this.r = this.a(); -+ getPathfinder().getPathfinder().world = world; // Paper ++ setWorld(); // Paper } public BlockPosition i() { +@@ -166,6 +168,7 @@ public abstract class NavigationAbstract { + } + + public void d() { ++ setWorld(); // Paper + ++this.e; + if (this.m) { + this.l(); diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java index 04c71ac0ef..6e583356ce 100644 --- a/src/main/java/net/minecraft/server/Pathfinder.java