diff options
author | V10lator <v10lator@myway.de> | 2012-04-25 11:45:28 +0200 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-06-23 10:18:50 -0500 |
commit | ea4d3662be7b6241ade2a620fb60a7817be006df (patch) | |
tree | 57dd8f29c79256ba816b746569818fabe15ff3c4 /src/main/java | |
parent | 568fae2e863a41f168f10c77090d16fe67e293bb (diff) | |
download | craftbukkit-ea4d3662be7b6241ade2a620fb60a7817be006df.tar craftbukkit-ea4d3662be7b6241ade2a620fb60a7817be006df.tar.gz craftbukkit-ea4d3662be7b6241ade2a620fb60a7817be006df.tar.lz craftbukkit-ea4d3662be7b6241ade2a620fb60a7817be006df.tar.xz craftbukkit-ea4d3662be7b6241ade2a620fb60a7817be006df.zip |
Deprecate spawnCreature and add spawnEntity. Addresses BUKKIT-1168
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2c41db32..b970ef8c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/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()); - - if (result == null) { - return null; - } + Validate.isTrue(!creatureType.isAlive(), "EntityType not instance of LivingEntity"); + return (LivingEntity) spawnEntity(loc, creatureType); + } - return (LivingEntity) result; + public Entity spawnEntity(Location loc, EntityType entityType) { + return spawn(loc, entityType.getEntityClass()); } public LightningStrike strikeLightning(Location loc) { |