diff options
author | Kodekpl <Kodekgames@gmail.com> | 2014-01-31 12:07:39 +0100 |
---|---|---|
committer | turt2live <travpc@gmail.com> | 2014-02-01 22:29:15 -0700 |
commit | 3e896afe6b2592de9b4129d7dc2cebe98dbb030c (patch) | |
tree | 15358c2ee03d675af2cfe68d39d17aa1ac26b719 /src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java | |
parent | c59ba98ae6c61c78827a33a3138ade5462d9ae11 (diff) | |
download | craftbukkit-3e896afe6b2592de9b4129d7dc2cebe98dbb030c.tar craftbukkit-3e896afe6b2592de9b4129d7dc2cebe98dbb030c.tar.gz craftbukkit-3e896afe6b2592de9b4129d7dc2cebe98dbb030c.tar.lz craftbukkit-3e896afe6b2592de9b4129d7dc2cebe98dbb030c.tar.xz craftbukkit-3e896afe6b2592de9b4129d7dc2cebe98dbb030c.zip |
Implement SpawnReason.NETHER_PORTAL and DISPENSE_EGG. Fixes BUKKIT-3148
Previously any entities spawned through dispensers (monster eggs) or
by nether portals were given the incorrect SpawnReason of SPAWNER_EGG.
This made it impossible to distinguish what exactly happened in regards
to the creature being spawned.
A method in ItemMonsterEgg has been added to further fine tune reasons
for spawning creatures. This permits the DISPENSE_EGG reason to be used
correctly and accuratly as well as the NETHER_PORTAL reason due to how
BlockPortal spawns the mobs.
The redirected method, a(World, int, double, double, double), is still
called by the ItemMonsterEgg itself and therefore uses the default reason
of SPAWNER_EGG. This does not change previous behaviour.
Diffstat (limited to 'src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java')
-rw-r--r-- | src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java index a854f7ae..2c14ab03 100644 --- a/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorMonsterEgg.java @@ -44,7 +44,7 @@ final class DispenseBehaviorMonsterEgg extends DispenseBehaviorItem { itemstack1 = CraftItemStack.asNMSCopy(event.getItem()); - Entity entity = ItemMonsterEgg.a(isourceblock.k(), itemstack.getData(), event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ()); + Entity entity = ItemMonsterEgg.spawnCreature(isourceblock.k(), itemstack.getData(), event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DISPENSE_EGG); if (entity instanceof EntityLiving && itemstack.hasName()) { ((EntityInsentient) entity).setCustomName(itemstack.getName()); |