1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2025-11-24 21:46:16 +00:00

add checkself flag command...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092
2015-10-01 23:56:11 +08:00
parent 2edf5ffc8a
commit fc502ae529
2 changed files with 33 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import com.bekvon.bukkit.residence.ResidenceMain;
import com.bekvon.bukkit.residence.commandsub.CommandArea;
import com.bekvon.bukkit.residence.commandsub.CommandBank;
import com.bekvon.bukkit.residence.commandsub.CommandCheck;
import com.bekvon.bukkit.residence.commandsub.CommandCheckSelf;
import com.bekvon.bukkit.residence.commandsub.CommandClearFlags;
import com.bekvon.bukkit.residence.commandsub.CommandCompass;
import com.bekvon.bukkit.residence.commandsub.CommandConfirm;
@@ -66,6 +67,7 @@ public class CommandRes extends BaseCommand implements DefaultCommand {
hdsubcmd.registerCommand(new CommandArea(plugin));
hdsubcmd.registerCommand(new CommandBank(plugin));
hdsubcmd.registerCommand(new CommandCheck(plugin));
hdsubcmd.registerCommand(new CommandCheckSelf(plugin));
hdsubcmd.registerCommand(new CommandClearFlags(plugin));
hdsubcmd.registerCommand(new CommandCompass(plugin));
hdsubcmd.registerCommand(new CommandConfirm(plugin));

View File

@@ -0,0 +1,31 @@
package com.bekvon.bukkit.residence.commandsub;
import org.bukkit.command.Command;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.bekvon.bukkit.residence.ResidenceMain;
import com.bekvon.bukkit.residence.protection.FlagPermissions;
import cn.citycraft.PluginHelper.commands.BaseCommand;
public class CommandCheckSelf extends BaseCommand {
ResidenceMain plugin;
public CommandCheckSelf(final ResidenceMain plugin) {
super("checkself");
this.plugin = plugin;
setOnlyPlayerExecutable();
setMinimumArguments(1);
setPossibleArguments("<权限>");
}
@Override
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
final Player player = (Player) sender;
final FlagPermissions perm = plugin.getPermsByLocForPlayer(player.getLocation(), player);
perm.checkValidFlag(args[0], false);
}
}