mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
Made world.spawnCreature just delegate to world.spawn. This fixes BUKKIT-57
This commit is contained in:
parent
efed2f0022
commit
6ea3cec762
1 changed files with 6 additions and 10 deletions
|
@ -320,17 +320,13 @@ public class CraftWorld implements World {
|
|||
}
|
||||
|
||||
public LivingEntity spawnCreature(Location loc, CreatureType creatureType) {
|
||||
LivingEntity creature;
|
||||
try {
|
||||
EntityLiving entityCreature = (EntityLiving) EntityTypes.a(creatureType.getName(), world);
|
||||
entityCreature.setPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
creature = (LivingEntity) CraftEntity.getEntity(server, entityCreature);
|
||||
world.addEntity(entityCreature, SpawnReason.CUSTOM);
|
||||
} catch (Exception e) {
|
||||
// if we fail, for any reason, return null.
|
||||
creature = null;
|
||||
Entity result = spawn(loc, creatureType.getEntityClass());
|
||||
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
return creature;
|
||||
|
||||
return (LivingEntity)result;
|
||||
}
|
||||
|
||||
public LightningStrike strikeLightning(Location loc) {
|
||||
|
|
Loading…
Reference in a new issue