mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
Improved CreatureSpawnEvent and made Water Animals obey spawn-animals setting.
This commit is contained in:
parent
baa92bdd06
commit
f627b69be9
1 changed files with 4 additions and 7 deletions
|
@ -821,6 +821,10 @@ public class World implements IBlockAccess {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (entity instanceof EntityLiving && entity instanceof EntityWaterAnimal && !this.allowAnimals) {
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (!flag && !this.isChunkLoaded(i, j)) {
|
||||
|
@ -1934,13 +1938,6 @@ public class World implements IBlockAccess {
|
|||
for (int i = 0; i < list.size(); ++i) {
|
||||
entity = (Entity) list.get(i);
|
||||
|
||||
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
|
||||
CreatureSpawnEvent event = CraftEventFactory.callCreatureSpawnEvent((EntityLiving) entity);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
this.entityList.add(entity);
|
||||
// CraftBukkit end
|
||||
|
||||
|
|
Loading…
Reference in a new issue