1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2025-11-24 21:46:16 +00:00
Files
Residence/src/main/java/com/bekvon/bukkit/residence/commandsub/CommandCheckSelf.java
j502647092 ad4f3bd6da add checkworld...
Signed-off-by: j502647092 <jtb1@163.com>
2015-10-02 01:03:23 +08:00

40 lines
1.2 KiB
Java

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();
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);
switch (args.length) {
case 0:
player.sendMessage("§e权限列表: ");
perm.printFlags(player);
return;
case 1:
final String flag = args[0];
player.sendMessage("§e权限检查: §a" + flag + " " + (perm.checkValidFlag(flag, false) ? "§atrue" : "§cfalse"));
return;
}
}
}