From 9ce9ed3657f99f127bf194e8c042af781c1bf0be Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 26 Nov 2010 21:29:27 -0800 Subject: [PATCH] Fixed error caused by not specifying a mob spawner type. --- src/WorldEditListener.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/WorldEditListener.java b/src/WorldEditListener.java index cf8ae9f42..d43d994a9 100755 --- a/src/WorldEditListener.java +++ b/src/WorldEditListener.java @@ -257,10 +257,14 @@ public class WorldEditListener extends PluginListener { text[3] = args0.length > 4 ? args0[4] : ""; return new SignBlock(blockType.getID(), data, text); } else if (blockType == BlockType.MOB_SPAWNER) { - if (!ServerInterface.isValidMobType(args0[1])) { - throw new InvalidItemException(arg, "Unknown mob type '" + args0[1] + "'"); + if (args0.length > 0) { + if (!ServerInterface.isValidMobType(args0[1])) { + throw new InvalidItemException(arg, "Unknown mob type '" + args0[1] + "'"); + } + return new MobSpawnerBlock(data, args0[1]); + } else { + return new MobSpawnerBlock(data, "Pig"); } - return new MobSpawnerBlock(data, args0[1]); } return new BaseBlock(blockType.getID(), data);