From aa92f0e3134638a0a83738644b641e11edd3dd36 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Sun, 12 Aug 2012 14:02:57 -0500 Subject: [PATCH] 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) --- .../bukkit/craftbukkit/block/CraftCreatureSpawner.java | 9 +++++---- 1 file 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 7bb3d43d39..fd2e6ba2d4 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; }