Entity#fromMobSpawner()

This commit is contained in:
BillyGalbreath
2017-06-18 18:17:05 -05:00
parent 3edcdeaf22
commit 760d9e300f
4 changed files with 108 additions and 98 deletions

View File

@@ -40,7 +40,7 @@
} else {
boolean flag = false;
RandomSource randomsource = world.getRandom();
@@ -157,13 +164,24 @@
@@ -157,13 +164,25 @@
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), EntitySpawnReason.SPAWNER, (SpawnGroupData) null);
}
@@ -58,6 +58,7 @@
}
- if (!world.tryAddFreshEntityWithPassengers(entity)) {
+ entity.spawnedViaMobSpawner = true; // Paper
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
+ continue;