mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2025-09-06 11:06:58 +00:00
添加查看自身权限包功能
This commit is contained in:
@ -1,48 +0,0 @@
|
||||
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 + "参数不正确"));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user