1
1
mirror of https://github.com/geekfrog/PermissionsTime.git synced 2025-09-06 11:06:58 +00:00

设置、移除、测试权限组添加

This commit is contained in:
GeekFrog
2017-07-13 07:17:41 +08:00
parent 193f0a7dc4
commit e0e3ce448c
13 changed files with 347 additions and 79 deletions

View File

@ -0,0 +1,48 @@
package gg.frog.mc.permissionstime.command;
import java.util.UUID;
import org.bukkit.command.CommandSender;
import gg.frog.mc.permissionstime.PluginMain;
import gg.frog.mc.permissionstime.config.PluginCfg;
import gg.frog.mc.permissionstime.database.SqlManager;
import gg.frog.mc.permissionstime.utils.StrUtil;
public class RemoveAllCmd implements Runnable {
private PluginMain pm;
private SqlManager sm;
private String[] args;
private CommandSender sender;
public RemoveAllCmd(PluginMain pm, CommandSender sender, String[] args) {
this.pm = pm;
this.sm = pm.getSqlManager();
this.sender = sender;
this.args = args;
}
@Override
public void run() {
if (args.length == 2) {
String playerName = args[1];
UUID uuid = pm.getPlayerUUIDByName(playerName);
if (uuid != null) {
if (PluginCfg.IS_DEBUG) {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + uuid.toString()));
}
if (sm.removeAllTime(uuid.toString())) {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "删除玩家 {0} 的所有权限包", playerName));
} else {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "未删除玩家 {0} 的所有权限包", playerName));
}
} else {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "找不到名为''{0}''的玩家", playerName));
}
} else {
sender.sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "参数不正确"));
}
}
}