org.bukkit.permissions.Permission.recalculatePermissibles()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(70)

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

Permission.recalculatePermissibles介绍

[英]Recalculates all Permissibles that contain this permission.

This should be called after modifying the children, and is automatically called after modifying the default value
[中]重新计算包含此权限的所有权限。
这应该在修改子项后调用,并在修改默认值后自动调用

代码示例

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

public Permission(String name, String description, PermissionDefault defaultValue, Map<String, Boolean> children) {
  this.name = name;
  this.description = (description == null) ? "" : description;
  if (defaultValue != null) {
    this.defaultValue = defaultValue;
  }
  if (children != null) {
    this.children.putAll(children);
  }
  recalculatePermissibles();
}

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

/**
 * Sets the default value of this permission.
 * <p>
 * This will not be saved to disk, and is a temporary operation until the
 * server reloads permissions. Changing this default will cause all {@link
 * Permissible}s that contain this permission to recalculate their
 * permissions
 *
 * @param value The new default to set
 */
public void setDefault(PermissionDefault value) {
  if (defaultValue == null) {
    throw new IllegalArgumentException("Default value cannot be null");
  }
  defaultValue = value;
  recalculatePermissibles();
}

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

/**
 * Adds this permission to the specified parent permission.
 *
 * @param perm Parent permission to register with
 * @param value The value to set this permission to
 */
public void addParent(Permission perm, boolean value) {
  perm.getChildren().put(getName(), value);
  perm.recalculatePermissibles();
}

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

public static Permission registerPermissions(Permission parent) {
    Permission broadcasts = DefaultPermissions.registerPermission(ROOT, "Allows the user to receive all broadcast messages", parent);

    DefaultPermissions.registerPermission(PREFIX + "admin", "Allows the user to receive administrative broadcasts", PermissionDefault.OP, broadcasts);
    DefaultPermissions.registerPermission(PREFIX + "user", "Allows the user to receive user broadcasts", PermissionDefault.TRUE, broadcasts);

    broadcasts.recalculatePermissibles();

    return broadcasts;
  }
}

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

public static void registerCorePermissions() {
    Permission parent = registerPermission(ROOT, "Gives the user the ability to use all CraftBukkit utilities and commands");

    CommandPermissions.registerPermissions(parent);
    BroadcastPermissions.registerPermissions(parent);

    parent.recalculatePermissibles();
  }
}

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

private static Permission registerTime(Permission parent) {
  Permission time = DefaultPermissions.registerPermission(PREFIX + "time", "Allows the user to alter the time", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "time.add", "Allows the user to fast-forward time", time);
  DefaultPermissions.registerPermission(PREFIX + "time.set", "Allows the user to change the time", time);
  time.recalculatePermissibles();
  return time;
}

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

private static Permission registerUnban(Permission parent) {
  Permission unban = DefaultPermissions.registerPermission(PREFIX + "unban", "Allows the user to unban people", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "unban.player", "Allows the user to unban players", unban);
  DefaultPermissions.registerPermission(PREFIX + "unban.ip", "Allows the user to unban IP addresses", unban);
  unban.recalculatePermissibles();
  return unban;
}

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

private static Permission registerBan(Permission parent) {
  Permission ban = DefaultPermissions.registerPermission(PREFIX + "ban", "Allows the user to ban people", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "ban.player", "Allows the user to ban players", ban);
  DefaultPermissions.registerPermission(PREFIX + "ban.ip", "Allows the user to ban IP addresses", ban);
  ban.recalculatePermissibles();
  return ban;
}

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

private static Permission registerOp(Permission parent) {
  Permission op = DefaultPermissions.registerPermission(PREFIX + "op", "Allows the user to change operators", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "op.give", "Allows the user to give a player operator status", op);
  DefaultPermissions.registerPermission(PREFIX + "op.take", "Allows the user to take a players operator status", op);
  op.recalculatePermissibles();
  return op;
}

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

private static Permission registerSave(Permission parent) {
  Permission save = DefaultPermissions.registerPermission(PREFIX + "save", "Allows the user to save the worlds", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "save.enable", "Allows the user to enable automatic saving", save);
  DefaultPermissions.registerPermission(PREFIX + "save.disable", "Allows the user to disable automatic saving", save);
  DefaultPermissions.registerPermission(PREFIX + "save.perform", "Allows the user to perform a manual save", save);
  save.recalculatePermissibles();
  return save;
}

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

private static Permission registerWhitelist(Permission parent) {
  Permission whitelist = DefaultPermissions.registerPermission(PREFIX + "whitelist", "Allows the user to modify the server whitelist", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.add", "Allows the user to add a player to the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.remove", "Allows the user to remove a player from the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.reload", "Allows the user to reload the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.enable", "Allows the user to enable the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.disable", "Allows the user to disable the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.list", "Allows the user to list all the users on the server whitelist", whitelist);
  whitelist.recalculatePermissibles();
  return whitelist;
}

代码示例来源:origin: GlowstoneMC/Glowstone

.registerPermission("minecraft.command.tell", "Allows the user to send a "
        + "private message", PermissionDefault.TRUE, permissionRootCommand);
permissionRootCommand.recalculatePermissibles();
permissionRoot.recalculatePermissibles();
helpMap.initializeCommands();
helpMap.amendTopics(config.getConfigFile(Key.HELP_FILE));

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

DefaultPermissions.registerPermission(PREFIX + "effect", "Allows the user to add/remove effects on players", PermissionDefault.OP, commands);
commands.recalculatePermissibles();

代码示例来源:origin: SpigotMC/Spigot-API

public Permission(String name, String description, PermissionDefault defaultValue, Map<String, Boolean> children) {
  this.name = name;
  this.description = (description == null) ? "" : description;
  if (defaultValue != null) {
    this.defaultValue = defaultValue;
  }
  if (children != null) {
    this.children.putAll(children);
  }
  recalculatePermissibles();
}

代码示例来源:origin: SpigotMC/Spigot-API

private static Permission registerBan(Permission parent) {
  Permission ban = DefaultPermissions.registerPermission(PREFIX + "ban", "Allows the user to ban people", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "ban.player", "Allows the user to ban players", ban);
  DefaultPermissions.registerPermission(PREFIX + "ban.ip", "Allows the user to ban IP addresses", ban);
  ban.recalculatePermissibles();
  return ban;
}

代码示例来源:origin: SpigotMC/Spigot-API

private static Permission registerUnban(Permission parent) {
  Permission unban = DefaultPermissions.registerPermission(PREFIX + "unban", "Allows the user to unban people", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "unban.player", "Allows the user to unban players", unban);
  DefaultPermissions.registerPermission(PREFIX + "unban.ip", "Allows the user to unban IP addresses", unban);
  unban.recalculatePermissibles();
  return unban;
}

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

private void updateAndAdd(PluginManager pm, Permission permission) {
    Permission oldPerm = pm.getPermission(permission.getName());
    if (oldPerm == null) {
      pm.addPermission(permission);
    }
    permission.recalculatePermissibles();
  }
}

代码示例来源:origin: SpigotMC/Spigot-API

private static Permission registerOp(Permission parent) {
  Permission op = DefaultPermissions.registerPermission(PREFIX + "op", "Allows the user to change operators", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "op.give", "Allows the user to give a player operator status", op);
  DefaultPermissions.registerPermission(PREFIX + "op.take", "Allows the user to take a players operator status", op);
  op.recalculatePermissibles();
  return op;
}

代码示例来源:origin: SpigotMC/Spigot-API

private static Permission registerSave(Permission parent) {
  Permission save = DefaultPermissions.registerPermission(PREFIX + "save", "Allows the user to save the worlds", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "save.enable", "Allows the user to enable automatic saving", save);
  DefaultPermissions.registerPermission(PREFIX + "save.disable", "Allows the user to disable automatic saving", save);
  DefaultPermissions.registerPermission(PREFIX + "save.perform", "Allows the user to perform a manual save", save);
  save.recalculatePermissibles();
  return save;
}

代码示例来源:origin: SpigotMC/Spigot-API

private static Permission registerWhitelist(Permission parent) {
  Permission whitelist = DefaultPermissions.registerPermission(PREFIX + "whitelist", "Allows the user to modify the server whitelist", PermissionDefault.OP, parent);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.add", "Allows the user to add a player to the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.remove", "Allows the user to remove a player from the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.reload", "Allows the user to reload the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.enable", "Allows the user to enable the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.disable", "Allows the user to disable the server whitelist", whitelist);
  DefaultPermissions.registerPermission(PREFIX + "whitelist.list", "Allows the user to list all the users on the server whitelist", whitelist);
  whitelist.recalculatePermissibles();
  return whitelist;
}

相关文章