World.spawnCreature now returns LivingEntity instead of Creature, to allow Ghasts and Slimes to be spawned using the command.

This commit is contained in:
Celtic Minstrel 2011-03-19 01:29:21 -04:00 committed by Erik Broes
parent abf7f8581e
commit cd50683f78

View File

@ -342,10 +342,10 @@ public class CraftWorld implements World {
return (Boat) boat.getBukkitEntity();
}
public Creature spawnCreature(Location loc, CreatureType creatureType) {
Creature creature;
public LivingEntity spawnCreature(Location loc, CreatureType creatureType) {
LivingEntity creature;
try {
EntityCreature entityCreature = (EntityCreature) EntityTypes.a(creatureType.getName(), world);
EntityLiving entityCreature = (EntityLiving) EntityTypes.a(creatureType.getName(), world);
entityCreature.a(loc.getX(), loc.getY(), loc.getZ());
creature = (Creature) CraftEntity.getEntity(server, entityCreature);
world.a(entityCreature);