mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-10-01 16:47:29 +02:00
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:
parent
37b2ad7e1d
commit
7f690ae7d8
35
src/com/onarandombox/MultiVerseCore/commands/MVPurge.java
Normal file
35
src/com/onarandombox/MultiVerseCore/commands/MVPurge.java
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -59,4 +59,11 @@ commands:
|
|||||||
mvreload:
|
mvreload:
|
||||||
description: Reload Configuration files.
|
description: Reload Configuration files.
|
||||||
usage: /<command>
|
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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user