SPIGOT-4534: Only call event for new chunks

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2018-12-17 21:36:21 +11:00
parent 0d2bc86153
commit 7114dbbb9d

View File

@ -149,7 +149,7 @@
+ List<Entity> toRemove = new LinkedList<>();
this.world.a(entityslice.stream().filter((entity) -> {
+ if (!CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
+ if (this.needsDecoration && !CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { // Only call for new chunks
+ toRemove.add(entity);
+ return false;
+ }