Example #1
0
 @Override
 public int broadcast(String message, String permission) {
   int count = 0;
   for (Permissible permissible : getPluginManager().getPermissionSubscriptions(permission)) {
     if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
       ((CommandSender) permissible).sendMessage(message);
       ++count;
     }
   }
   return count;
 }
Example #2
0
  @Override
  public boolean dispatchCommand(CommandSender sender, String commandLine) throws CommandException {
    if (commandMap.dispatch(sender, commandLine)) {
      return true;
    }

    String firstword = commandLine;
    if (firstword.indexOf(' ') >= 0) {
      firstword = firstword.substring(0, firstword.indexOf(' '));
    }

    sender.sendMessage(ChatColor.GRAY + "Unknown command \"" + firstword + "\", try \"help\"");
    return false;
  }