2018-09-29 01:31:59 +02:00
|
|
|
From 662cf614a03e90feb9aaad1d22300aee82391b4c Mon Sep 17 00:00:00 2001
|
2018-07-15 03:53:17 +02: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
|
2018-09-01 00:56:57 +02:00
|
|
|
index 5d6f726d05..a8b070ed32 100644
|
2018-07-15 03:53:17 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
2018-09-01 00:56:57 +02:00
|
|
|
@@ -3,7 +3,7 @@ package net.minecraft.server;
|
|
|
|
import javax.annotation.Nullable;
|
2018-07-15 03:53:17 +02:00
|
|
|
|
|
|
|
public abstract class NavigationAbstract {
|
|
|
|
- protected EntityInsentient a;
|
|
|
|
+ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER
|
|
|
|
protected World b;
|
|
|
|
@Nullable
|
|
|
|
protected PathEntity c;
|
2018-09-01 00:56:57 +02:00
|
|
|
@@ -74,6 +74,7 @@ public abstract class NavigationAbstract {
|
2018-07-15 03:53:17 +02:00
|
|
|
} 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;
|
2018-09-01 00:56:57 +02:00
|
|
|
float fx = this.j();
|
|
|
|
this.b.methodProfiler.a("pathfind");
|
|
|
|
@@ -95,6 +96,7 @@ public abstract class NavigationAbstract {
|
2018-07-15 03:53:17 +02:00
|
|
|
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;
|
2018-09-01 00:56:57 +02:00
|
|
|
float fx = this.j();
|
|
|
|
this.b.methodProfiler.a("pathfind");
|
2018-07-15 03:53:17 +02:00
|
|
|
--
|
2018-09-29 01:31:59 +02:00
|
|
|
2.19.0
|
2018-07-15 03:53:17 +02:00
|
|
|
|