2016-05-12 02:07:46 +00:00
|
|
|
From e372ab08e338bcd4b27cb23fc386fc9cda543788 Mon Sep 17 00:00:00 2001
|
2016-03-29 01:24:45 +00: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
|
2016-05-12 02:07:46 +00:00
|
|
|
index 61c0f55..ea3cd66 100644
|
2016-03-29 01:24:45 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
|
2016-03-29 01:24:45 +00:00
|
|
|
public abstract class NavigationAbstract {
|
|
|
|
|
|
|
|
private static int f = 20;
|
|
|
|
- protected EntityInsentient a;
|
|
|
|
+ protected EntityInsentient a;public Entity getEntity() { return a; } // Paper
|
|
|
|
protected World b;
|
2016-05-12 02:07:46 +00:00
|
|
|
@Nullable
|
2016-03-29 01:24:45 +00:00
|
|
|
protected PathEntity c;
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -77,6 +77,7 @@ public abstract class NavigationAbstract {
|
2016-03-29 01:24:45 +00:00
|
|
|
} else if (this.c != null && !this.c.b() && blockposition.equals(this.r)) {
|
|
|
|
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.r = blockposition;
|
|
|
|
float f = this.h();
|
|
|
|
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -101,6 +102,7 @@ public abstract class NavigationAbstract {
|
2016-03-29 01:24:45 +00:00
|
|
|
if (this.c != null && !this.c.b() && blockposition.equals(this.r)) {
|
|
|
|
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.r = blockposition;
|
|
|
|
float f = this.h();
|
|
|
|
|
|
|
|
--
|
2016-05-12 02:07:46 +00:00
|
|
|
2.8.2
|
2016-03-29 01:24:45 +00:00
|
|
|
|