Implement SpawnerSpawnEvent
By: md_5 <git@md-5.net> Also-by: Andy Shulman <andy.shulman@hotmail.com>
This commit is contained in:
@@ -8,12 +8,17 @@
|
||||
}
|
||||
|
||||
private boolean isNearPlayer(World world, BlockPosition blockposition) {
|
||||
@@ -152,7 +153,7 @@
|
||||
@@ -152,7 +153,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (!worldserver.tryAddFreshEntityWithPassengers(entity)) {
|
||||
+ if (!worldserver.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) { // CraftBukkit
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (!worldserver.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) {
|
||||
+ // CraftBukkit end
|
||||
this.delay(worldserver, blockposition);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user