From f627b69be95fcc346fea21c5e25d0d95ca4cff74 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Thu, 9 Jun 2011 17:05:56 -0400 Subject: [PATCH] Improved CreatureSpawnEvent and made Water Animals obey spawn-animals setting. --- src/main/java/net/minecraft/server/World.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index aa4ac1fddc..c2b79fb9fc 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -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