From bd589a6b9a3cf8d00c32b32549a56993e8a3f4a5 Mon Sep 17 00:00:00 2001 From: Rigby Date: Fri, 18 Mar 2011 00:55:58 +0000 Subject: [PATCH] Quick fixes to the purge command. --- .../MultiVerseCore/commands/MVPurge.java | 12 ++++++++++-- src/plugin.yml | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java b/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java index 54563c33..84401091 100644 --- a/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java +++ b/src/com/onarandombox/MultiVerseCore/commands/MVPurge.java @@ -19,13 +19,21 @@ public class MVPurge extends MVCommandHandler { @Override public boolean perform(CommandSender sender, String[] args) { + if(!(args.length>0)){ + return false; + } + if(!(sender instanceof Player)){ sender.sendMessage("This command needs to be used from inside the game!"); return true; - } + } + Player p = (Player) sender; List creatures = new ArrayList(); - creatures.add(args[0].toUpperCase()); + + for(String creature : args[0].toUpperCase().split(",")){ + creatures.add(creature); + } new PurgeWorlds(plugin).purge(sender, p.getWorld(), creatures); diff --git a/src/plugin.yml b/src/plugin.yml index 3a162e10..e51ff1fb 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -65,5 +65,4 @@ commands: / [world] [creatures] / -- Purges the players world of all creatures. / creative * -- Purges the creative world of all Creatures. - / creative creeper -- Purges the creative world of all CREEPERS. - \ No newline at end of file + / creative creeper -- Purges the creative world of all CREEPERS. \ No newline at end of file