From 315127782a86659d8ac353408ce385e0b8ee9ddb Mon Sep 17 00:00:00 2001 From: feildmaster Date: Wed, 16 Jan 2013 22:37:09 -0600 Subject: [PATCH] Initialize entity data before spawning them. Fixes BUKKIT-3209 Vanilla does the initialize before spawning everywhere except in the SpawnerCreature, our spawn event depends on this behavior to be consistent. --- .../java/net/minecraft/server/SpawnerCreature.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java index c0ffb1bbe6..9b3e262618 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -154,9 +154,10 @@ public final class SpawnerCreature { entityliving.setPositionRotation((double) f, (double) f1, (double) f2, worldserver.random.nextFloat() * 360.0F, 0.0F); if (entityliving.canSpawn()) { ++j2; - // CraftBukkit - added a reason for spawning this creature - worldserver.addEntity(entityliving, SpawnReason.NATURAL); + // CraftBukkit start - added a reason for spawning this creature, moved a(entityliving, world...) up a(entityliving, worldserver, f, f1, f2); + worldserver.addEntity(entityliving, SpawnReason.NATURAL); + // CraftBukkit end if (j2 >= entityliving.bv()) { continue label110; } @@ -199,7 +200,6 @@ public final class SpawnerCreature { } private static void a(EntityLiving entityliving, World world, float f, float f1, float f2) { - if (entityliving.dead) return; // CraftBukkit entityliving.bG(); } @@ -236,9 +236,10 @@ public final class SpawnerCreature { } entityliving.setPositionRotation((double) f, (double) f1, (double) f2, random.nextFloat() * 360.0F, 0.0F); - // CraftBukkit - added a reason for spawning this creature - world.addEntity(entityliving, SpawnReason.CHUNK_GEN); + // CraftBukkit start - added a reason for spawning this creature, moved a(entity, world...) up a(entityliving, world, f, f1, f2); + world.addEntity(entityliving, SpawnReason.CHUNK_GEN); + // CraftBukkit end flag = true; }