Do not call EntityRemoveEvent during worldgen (#12588)

Ports the follow commits from spigot to paper.
All credits to go the respective commit authors listed below.

CraftBukkit: 3b4fd5b321f4440a2b3a67f3945739b45e6e687f

By: md_5 <git@md-5.net>
This commit is contained in:
Bjarne Koll
2025-05-24 22:17:42 +02:00
committed by GitHub
parent 220b57add4
commit b8fe22c9cd
2 changed files with 8 additions and 3 deletions

View File

@@ -1961,6 +1961,11 @@ public class CraftEventFactory {
return;
}
// SPIGOT-8041: Do not call event unless entity has been spawned into world
if (!entity.inWorld) {
return;
}
Bukkit.getPluginManager().callEvent(new EntityRemoveEvent(entity.getBukkitEntity(), cause));
}