2018-08-27 02:11:49 +08:00
|
|
|
From 23dbf833e038bf5d565bba44919c95322ef55e3e Mon Sep 17 00:00:00 2001
|
2016-03-29 08:33:10 +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/World.java b/src/main/java/net/minecraft/server/World.java
|
2018-08-27 02:11:49 +08:00
|
|
|
index 8f3b1d529a..7f39a321db 100644
|
2016-03-29 08:33:10 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2018-08-27 02:11:49 +08:00
|
|
|
@@ -1069,6 +1069,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
2016-03-29 08:33:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
entity.valid = true; // CraftBukkit
|
2016-03-29 08:58:42 +08:00
|
|
|
+ new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
2016-03-29 08:33:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void c(Entity entity) {
|
2018-08-27 02:11:49 +08:00
|
|
|
@@ -1076,6 +1077,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
2018-07-15 09:53:17 +08:00
|
|
|
((IWorldAccess) this.v.get(i)).b(entity);
|
2016-03-29 08:33:10 +08:00
|
|
|
}
|
|
|
|
|
2016-03-29 08:57:15 +08:00
|
|
|
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
2016-03-29 08:33:10 +08:00
|
|
|
entity.valid = false; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2018-07-04 15:55:24 +08:00
|
|
|
2.18.0
|
2016-03-29 08:33:10 +08:00
|
|
|
|