diff options
author | feildmaster <admin@feildmaster.com> | 2013-01-16 22:37:09 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-01-16 23:05:18 -0600 |
commit | 315127782a86659d8ac353408ce385e0b8ee9ddb (patch) | |
tree | e5690ac6e9a3d0632e80b3bd1d52383a9f5c506b | |
parent | b581068464e55f4ff6c45b0a532d0279d7c152e4 (diff) | |
download | craftbukkit-315127782a86659d8ac353408ce385e0b8ee9ddb.tar craftbukkit-315127782a86659d8ac353408ce385e0b8ee9ddb.tar.gz craftbukkit-315127782a86659d8ac353408ce385e0b8ee9ddb.tar.lz craftbukkit-315127782a86659d8ac353408ce385e0b8ee9ddb.tar.xz craftbukkit-315127782a86659d8ac353408ce385e0b8ee9ddb.zip |
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.
-rw-r--r-- | src/main/java/net/minecraft/server/SpawnerCreature.java | 11 |
1 files 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 c0ffb1bb..9b3e2626 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; } |