aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0095-EntityPathfindEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0095-EntityPathfindEvent.patch')
-rw-r--r--Spigot-Server-Patches/0095-EntityPathfindEvent.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0095-EntityPathfindEvent.patch b/Spigot-Server-Patches/0095-EntityPathfindEvent.patch
new file mode 100644
index 0000000000..53c511170a
--- /dev/null
+++ b/Spigot-Server-Patches/0095-EntityPathfindEvent.patch
@@ -0,0 +1,39 @@
+From d3c9388de3e0dc2bbc6c1b12eb76d09c48af1d08 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Mon, 28 Mar 2016 21:22:26 -0400
+Subject: [PATCH] EntityPathfindEvent
+
+Fires when an Entity decides to start moving to a location.
+
+diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
+index 43b2be505..c0ef2400b 100644
+--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
+@@ -4,7 +4,7 @@ import javax.annotation.Nullable;
+
+ public abstract class NavigationAbstract {
+
+- protected EntityInsentient a;
++ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
+ protected World b;
+ @Nullable
+ protected PathEntity c;
+@@ -74,6 +74,7 @@ public abstract class NavigationAbstract {
+ } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
+ return this.c;
+ } else {
++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
+ this.q = blockposition;
+ float f = this.h();
+
+@@ -98,6 +99,7 @@ public abstract class NavigationAbstract {
+ if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
+ return this.c;
+ } else {
++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper
+ this.q = blockposition;
+ float f = this.h();
+
+--
+2.12.2
+