Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-Server-Patches/0115-EntityPathfindEvent.patch

40 Zeilen
1.8 KiB
Diff

2016-04-02 04:08:40 +02:00
From 06aaa486af57482d6a528208bbaabd477b11ddd3 Mon Sep 17 00:00:00 2001
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
index 9687785..0926d22 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -3,7 +3,7 @@ package net.minecraft.server;
public abstract class NavigationAbstract {
private static int f = 20;
- protected EntityInsentient a;
+ protected EntityInsentient a;public Entity getEntity() { return a; } // Paper
protected World b;
protected PathEntity c;
protected double d;
@@ -73,6 +73,7 @@ public abstract class NavigationAbstract {
} 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();
@@ -96,6 +97,7 @@ public abstract class NavigationAbstract {
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-03-31 02:50:23 +02:00
2.8.0