Paper/Spigot-Server-Patches/0075-Entity-AddTo-RemoveFrom-World-Events.patch

31 lines
1.2 KiB
Diff
Raw Normal View History

2019-12-12 11:06:23 +08:00
From 95e3c5995098349a8c663fcb5198cee5b4dce478 Mon Sep 17 00:00:00 2001
2019-04-27 11:05:36 +08:00
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:32:58 -0400
Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
2019-12-12 11:06:23 +08:00
index 70b8b41ea..5a813c93f 100644
2019-04-27 11:05:36 +08:00
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2019-12-12 11:06:23 +08:00
@@ -1123,7 +1123,7 @@ public class WorldServer extends World {
if (entity instanceof EntityInsentient) {
2019-12-11 10:43:21 +08:00
this.navigators.remove(((EntityInsentient) entity).getNavigation());
}
-
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
entity.valid = false; // CraftBukkit
}
2019-12-12 11:06:23 +08:00
@@ -1161,6 +1161,7 @@ public class WorldServer extends World {
2019-05-06 05:39:51 +08:00
entity.origin = entity.getBukkitEntity().getLocation();
2019-04-27 11:05:36 +08:00
}
2019-05-06 05:39:51 +08:00
// Paper end
2019-04-27 11:05:36 +08:00
+ new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
}
--
2019-12-12 11:06:23 +08:00
2.24.1
2019-04-27 11:05:36 +08:00