From 25f555c6b923a7ad40cc4dd94c468d863952afcd Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 25 Apr 2012 11:45:28 +0200 Subject: [PATCH] Deprecate spawnCreature and add spawnEntity. Addresses BUKKIT-1168 By: V10lator --- .../main/java/org/bukkit/craftbukkit/CraftWorld.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2c41db32db..b970ef8c9f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -331,14 +331,14 @@ public class CraftWorld implements World { return spawnCreature(loc, creatureType.toEntityType()); } + @Deprecated public LivingEntity spawnCreature(Location loc, EntityType creatureType) { - Entity result = spawn(loc, creatureType.getEntityClass()); + Validate.isTrue(!creatureType.isAlive(), "EntityType not instance of LivingEntity"); + return (LivingEntity) spawnEntity(loc, creatureType); + } - if (result == null) { - return null; - } - - return (LivingEntity) result; + public Entity spawnEntity(Location loc, EntityType entityType) { + return spawn(loc, entityType.getEntityClass()); } public LightningStrike strikeLightning(Location loc) {