PaperMC/paper-server/nms-patches/WorldAccess.patch
CraftBukkit/Spigot 6450eb0ab7 Update to Minecraft 1.16.4
By: md_5 <git@md-5.net>
2020-11-03 07:00:00 +11:00

17 lines
627 B
Diff

--- a/net/minecraft/server/WorldAccess.java
+++ b/net/minecraft/server/WorldAccess.java
@@ -5,6 +5,13 @@
WorldServer getMinecraftWorld();
default void addAllEntities(Entity entity) {
- entity.cp().forEach(this::addEntity);
+ // CraftBukkit start
+ this.addAllEntities(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
}
+
+ default boolean addAllEntities(Entity entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ entity.cp().forEach((e) -> this.addEntity(e, reason));
+ return !entity.dead;
+ }
+ // CraftBukkit end
}