diff options
author | feildmaster <admin@feildmaster.com> | 2012-08-12 14:02:57 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-08-12 14:11:36 -0500 |
commit | aa92f0e3134638a0a83738644b641e11edd3dd36 (patch) | |
tree | f454f9059dce5a031ec58ee02a7a9435dd6589f4 | |
parent | bfc5189818c74b37cc3e67baead6545c80aeb960 (diff) | |
download | craftbukkit-aa92f0e3134638a0a83738644b641e11edd3dd36.tar craftbukkit-aa92f0e3134638a0a83738644b641e11edd3dd36.tar.gz craftbukkit-aa92f0e3134638a0a83738644b641e11edd3dd36.tar.lz craftbukkit-aa92f0e3134638a0a83738644b641e11edd3dd36.tar.xz craftbukkit-aa92f0e3134638a0a83738644b641e11edd3dd36.zip |
Update CreatureSpawner.setSpawnedType(EntityType) to 1.3
They can spawn any valid entities now. What is a "valid" entity? A "valid" entity is an EntityType with a non-null getName(). (for example: PRIMED_TNT, FALLING_BLOCK)
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index 7bb3d43d..fd2e6ba2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -33,14 +33,15 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa spawner.mobName = creatureType.getName(); } - public void setSpawnedType(EntityType creatureType) { - if (!creatureType.isAlive() || !creatureType.isSpawnable()) { - throw new IllegalArgumentException("Can't spawn non-living entities from mob spawners!"); + public void setSpawnedType(EntityType entityType) { + if (entityType == null || entityType.getName() == null) { + throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!"); } - spawner.mobName = creatureType.getName(); + spawner.mobName = entityType.getName(); } + @Deprecated public String getCreatureTypeId() { return spawner.mobName; } |