Basic PurgeWorld command, needs working on more for Permissions and

target worlds etc. Currently "/mvpurge CREATURETYPE" and "/mvpurge *"
work perfectly.
This commit is contained in:
Rigby 2011-03-14 12:14:27 +00:00
parent 37b2ad7e1d
commit 7f690ae7d8
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,35 @@
package com.onarandombox.MultiVerseCore.commands;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.onarandombox.utils.PurgeWorlds;
import com.onarandombox.MultiVerseCore.MVCommandHandler;
import com.onarandombox.MultiVerseCore.MultiVerseCore;
public class MVPurge extends MVCommandHandler {
public MVPurge(MultiVerseCore plugin) {
super(plugin);
}
@Override
public boolean perform(CommandSender sender, String[] args) {
if(!(sender instanceof Player)){
sender.sendMessage("This command needs to be used from inside the game!");
return true;
}
Player p = (Player) sender;
List<String> creatures = new ArrayList<String>();
creatures.add(args[0].toUpperCase());
new PurgeWorlds(plugin).purge(sender, p.getWorld(), creatures);
return true;
}
}

View File

@ -59,4 +59,11 @@ commands:
mvreload:
description: Reload Configuration files.
usage: /<command>
mvpurge:
description: Purge the targetted world of creatures.
usage: |
/<command> [world] [creatures]
/<command> -- Purges the players world of all creatures.
/<command> creative * -- Purges the creative world of all Creatures.
/<command> creative creeper -- Purges the creative world of all CREEPERS.