2018-01-11 13:31:19 +08:00
|
|
|
From c0bd0c65c216796321650a58bd0fd505ef23406b Mon Sep 17 00:00:00 2001
|
2016-03-29 09:24:45 +08:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
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
|
2017-06-19 09:36:55 +08:00
|
|
|
index cc44d30b..3ac6f84d 100644
|
2016-03-29 09:24:45 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
2016-06-09 11:57:14 +08:00
|
|
|
@@ -4,7 +4,7 @@ import javax.annotation.Nullable;
|
|
|
|
|
2016-03-29 09:24:45 +08:00
|
|
|
public abstract class NavigationAbstract {
|
|
|
|
|
|
|
|
- protected EntityInsentient a;
|
2016-06-09 11:57:14 +08:00
|
|
|
+ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
|
2016-03-29 09:24:45 +08:00
|
|
|
protected World b;
|
2016-05-12 10:07:46 +08:00
|
|
|
@Nullable
|
2016-03-29 09:24:45 +08:00
|
|
|
protected PathEntity c;
|
2016-06-09 11:57:14 +08:00
|
|
|
@@ -74,6 +74,7 @@ public abstract class NavigationAbstract {
|
|
|
|
} else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
|
2016-03-29 09:24:45 +08:00
|
|
|
return this.c;
|
|
|
|
} else {
|
|
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper
|
2016-06-09 11:57:14 +08:00
|
|
|
this.q = blockposition;
|
2017-05-15 02:05:01 +08:00
|
|
|
float f = this.i();
|
2016-03-29 09:24:45 +08:00
|
|
|
|
2016-06-09 11:57:14 +08:00
|
|
|
@@ -98,6 +99,7 @@ public abstract class NavigationAbstract {
|
|
|
|
if (this.c != null && !this.c.b() && blockposition.equals(this.q)) {
|
2016-03-29 09:24:45 +08:00
|
|
|
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
|
2016-06-09 11:57:14 +08:00
|
|
|
this.q = blockposition;
|
2017-05-15 02:05:01 +08:00
|
|
|
float f = this.i();
|
2016-03-29 09:24:45 +08:00
|
|
|
|
|
|
|
--
|
2018-01-11 13:31:19 +08:00
|
|
|
2.14.3
|
2016-03-29 09:24:45 +08:00
|
|
|
|