testserver/Spigot-Server-Patches/0097-Entity-AddTo-RemoveFro...

30 lines
1.1 KiB
Diff

From c056b9c4109ab49eb510cc72b9f1b984a96ff8bf Mon Sep 17 00:00:00 2001
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/World.java b/src/main/java/net/minecraft/server/World.java
index 019b185..2f92c78 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1179,6 +1179,7 @@ public abstract class World implements IBlockAccess {
}
entity.valid = true; // CraftBukkit
+ new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
protected void c(Entity entity) {
@@ -1186,6 +1187,7 @@ public abstract class World implements IBlockAccess {
((IWorldAccess) this.u.get(i)).b(entity);
}
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
entity.valid = false; // CraftBukkit
}
--
2.9.3