testserver/patches/server/0071-Entity-AddTo-RemoveFro...

27 lines
1.2 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 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/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
2021-06-12 02:24:43 +00:00
index 9394dd781bb27b273c442972c5923615ac406507..b1c9a21574d6adba5d01caea0abac16a0e214a8f 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
2021-06-12 02:24:43 +00:00
@@ -1116,6 +1116,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
2021-06-11 12:02:28 +00:00
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end
+ new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
}
2021-06-12 02:24:43 +00:00
@@ -1964,6 +1965,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
}
entity.valid = false; // CraftBukkit
+ new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
}
}