diff options
author | snowleo <schneeleo@gmail.com> | 2011-06-23 20:14:59 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-06-23 20:14:59 +0200 |
commit | d8e129e3f4c85970d9f9354c862a71b3dda78b7f (patch) | |
tree | 33cc627859ad5d22d1285965e86c1511eed3dddc | |
parent | 1aecf7b7b0a9b12014b3e80fe83d52061f09ad94 (diff) | |
download | Essentials-d8e129e3f4c85970d9f9354c862a71b3dda78b7f.tar Essentials-d8e129e3f4c85970d9f9354c862a71b3dda78b7f.tar.gz Essentials-d8e129e3f4c85970d9f9354c862a71b3dda78b7f.tar.lz Essentials-d8e129e3f4c85970d9f9354c862a71b3dda78b7f.tar.xz Essentials-d8e129e3f4c85970d9f9354c862a71b3dda78b7f.zip |
Fix /spawner command
The name had to be first letter uppercase, the rest lowercase
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawner.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index da0c0e274..df2f7f954 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -20,12 +20,12 @@ public class Commandspawner extends EssentialsCommand @Override protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { - if (args.length < 1) + if (args.length < 1 || args[0].length() < 2) { throw new NotEnoughArgumentsException(); } - Block target = user.getTarget().getTargetBlock(); + final Block target = user.getTarget().getTargetBlock(); if (target.getType() != Material.MOB_SPAWNER) { throw new Exception(Util.i18n("mobSpawnTarget")); @@ -34,7 +34,8 @@ public class Commandspawner extends EssentialsCommand charge(user); try { - new CraftCreatureSpawner(target).setCreatureType(CreatureType.fromName(args[0])); + final String name = args[0].substring(0, 1).toUpperCase() + args[0].substring(1).toLowerCase(); + new CraftCreatureSpawner(target).setCreatureType(CreatureType.fromName(name)); } catch (Throwable ex) { |