org.bukkit.command.Command.getPermissionMessage()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.bukkit.command.Command.getPermissionMessage()方法的一些代码示例,展示了Command.getPermissionMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Command.getPermissionMessage()方法的具体详情如下:
包路径:org.bukkit.command.Command
类名称:Command
方法名:getPermissionMessage

Command.getPermissionMessage介绍

[英]Returns a message to be displayed on a failed permission check for this command
[中]返回要在此命令的权限检查失败时显示的消息

代码示例

代码示例来源:origin: EngineHub/CommandHelper

@Override
public String getPermissionMessage() {
  return cmd.getPermissionMessage();
}

代码示例来源:origin: NoCheatPlus/NoCheatPlus

changed.add(new CommandProtectionEntry(command, lcLabel, cmdPermName, cmdPerm.getDefault(), command.getPermissionMessage()));
changed.add(new CommandProtectionEntry(command, lcLabel, null, null, command.getPermissionMessage()));

代码示例来源:origin: mcMMO-Dev/mcMMO

case 0:
  if (!checkTogglePermissions(sender)) {
    sender.sendMessage(command.getPermissionMessage());
    return true;
  if (CommandUtils.shouldEnableToggle(args[0])) {
    if (!Permissions.hardcoreToggle(sender)) {
      sender.sendMessage(command.getPermissionMessage());
      return true;
      sender.sendMessage(command.getPermissionMessage());
      return true;
    sender.sendMessage(command.getPermissionMessage());
    return true;
      sender.sendMessage(command.getPermissionMessage());
      return true;
      sender.sendMessage(command.getPermissionMessage());
      return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

case 0:
  if (!Permissions.mcmmoDescription(sender)) {
    sender.sendMessage(command.getPermissionMessage());
    return true;
  if (args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("commands")) {
    if (!Permissions.mcmmoHelp(sender)) {
      sender.sendMessage(command.getPermissionMessage());
      return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

private void display(int page, PrimarySkillType skill, CommandSender sender, Command command) {
  if (skill != null && !Permissions.mctop(sender, skill)) {
    sender.sendMessage(command.getPermissionMessage());
    return;
  }
  if (sender instanceof Player) {
    if (!CommandUtils.hasPlayerDataKey(sender)) {
      return;
    }
    McMMOPlayer mcMMOPlayer = UserManager.getPlayer(sender.getName());
    long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
    if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
      double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000;
      if (seconds < 1) {
        seconds = 1;
      }
      sender.sendMessage(LocaleLoader.formatString(LocaleLoader.getString("Commands.Database.Cooldown"), seconds));
      return;
    }
    if (((Player) sender).hasMetadata(mcMMO.databaseCommandKey)) {
      sender.sendMessage(LocaleLoader.getString("Commands.Database.Processing"));
      return;
    } else {
      ((Player) sender).setMetadata(mcMMO.databaseCommandKey, new FixedMetadataValue(mcMMO.p, null));
    }
    mcMMOPlayer.actualizeDatabaseATS();
  }
  display(page, skill, sender);
}

代码示例来源:origin: mcMMO-Dev/mcMMO

@Override
  public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!Permissions.partyTeleportToggle(sender)) {
      sender.sendMessage(command.getPermissionMessage());
      return true;
    }

    PartyTeleportRecord ptpRecord = UserManager.getPlayer(sender.getName()).getPartyTeleportRecord();

    if (ptpRecord.isEnabled()) {
      sender.sendMessage(LocaleLoader.getString("Commands.ptp.Disabled"));
    }
    else {
      sender.sendMessage(LocaleLoader.getString("Commands.ptp.Enabled"));
    }

    ptpRecord.toggleEnabled();
    return true;
  }
}

代码示例来源:origin: mcMMO-Dev/mcMMO

@Override
  public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!Permissions.partyTeleportAcceptAll(sender)) {
      sender.sendMessage(command.getPermissionMessage());
      return true;
    }

    PartyTeleportRecord ptpRecord = UserManager.getPlayer(sender.getName()).getPartyTeleportRecord();

    if (ptpRecord.isConfirmRequired()) {
      sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Disabled"));
    }
    else {
      sender.sendMessage(LocaleLoader.getString("Commands.ptp.AcceptAny.Enabled"));
    }

    ptpRecord.toggleConfirmRequired();
    return true;
  }
}

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

sender.sendMessage(command.getPermissionMessage());
return true;
sender.sendMessage(command.getPermissionMessage());
return true;

代码示例来源:origin: mcMMO-Dev/mcMMO

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  if (!Permissions.partyTeleportAccept(sender)) {
    sender.sendMessage(command.getPermissionMessage());
    return true;

相关文章