本文整理了Java中org.bukkit.command.Command.getPermission()
方法的一些代码示例,展示了Command.getPermission()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Command.getPermission()
方法的具体详情如下:
包路径:org.bukkit.command.Command
类名称:Command
方法名:getPermission
[英]Gets the permission required by users to be able to perform this command
[中]获取用户执行此命令所需的权限
代码示例来源:origin: EngineHub/CommandHelper
@Override
public String getPermission() {
return cmd.getPermission();
}
代码示例来源:origin: NoCheatPlus/NoCheatPlus
String cmdPermName = command.getPermission();
final boolean cmdHadPerm;
if (cmdPermName == null) {
代码示例来源:origin: EngineHub/CommandBook
Collection<org.bukkit.command.Command> serverCommands = getServerCommands();
for (Iterator<org.bukkit.command.Command> i = serverCommands.iterator(); i.hasNext();) {
final String permission = i.next().getPermission();
if (!(permission == null || permission.length() == 0 || CommandBook.inst().hasPermission(sender, permission))) {
i.remove();
代码示例来源:origin: games647/ChangeSkin
if (!sender.hasPermission(command.getPermission() + ".other")) {
plugin.sendMessage(sender, "no-permission-other");
return true;
代码示例来源:origin: games647/LagMonitor
private void displayPingOther(CommandSender sender, Command command, String playerName) {
if (sender.hasPermission(command.getPermission() + ".other")) {
RollingOverHistory sampleHistory = plugin.getPingManager().getHistory(playerName);
if (sampleHistory == null || !canSee(sender, playerName)) {
sendError(sender, "No data for that player " + playerName);
return;
}
int lastPing = (int) sampleHistory.getLastSample();
sender.sendMessage(ChatColor.WHITE + playerName + PRIMARY_COLOR + "'s ping is: "
+ ChatColor.DARK_GREEN + lastPing + "ms");
float pingAverage = LagUtils.round(sampleHistory.getAverage());
sender.sendMessage(PRIMARY_COLOR + "Average: " + ChatColor.DARK_GREEN + pingAverage + "ms");
} else {
sendError(sender, "You don't have enough permission");
}
}
内容来源于网络,如有侵权,请联系作者删除!