类 PermissionAttachment

java.lang.Object
org.bukkit.permissions.PermissionAttachment

public class PermissionAttachment extends Object
保存关于Permissible对象上权限附件的信息
  • 构造器详细资料

  • 方法详细资料

    • getPlugin

      @NotNull public @NotNull Plugin getPlugin()
      获取负责此附件的插件.

      原文: Gets the plugin responsible for this attachment

      返回:
      负责此权限附件的插件
    • setRemovalCallback

      public void setRemovalCallback(@Nullable @Nullable PermissionRemovedExecutor ex)
      设置当此附件从Permissible移除时调用的对象. 可能为null.

      原文: Sets an object to be called for when this attachment is removed from a Permissible. May be null.

      参数:
      ex - 移除时调用的对象
    • getRemovalCallback

      @Nullable public @Nullable PermissionRemovedExecutor getRemovalCallback()
      获取之前设置的当此附件从Permissible移除时调用的类. 可能为null.

      原文: Gets the class that was previously set to be called when this attachment was removed from a Permissible. May be null.

      返回:
      移除时调用的对象
    • getPermissible

      @NotNull public @NotNull Permissible getPermissible()
      获取此附件附加到的Permissible.

      原文: Gets the Permissible that this is attached to

      返回:
      包含此附件的Permissible
    • getPermissions

      @NotNull public @NotNull Map<String,Boolean> getPermissions()
      获取此附件中包含的所有已设置权限和值的副本.

      此映射可以被修改但不会影响附件, 因为它是一个副本.

      原文: Gets a copy of all set permissions and values contained within this attachment.

      This map may be modified but will not affect the attachment, as it is a copy.

      返回:
      此附件表达的所有权限和值的副本
    • setPermission

      public void setPermission(@NotNull @NotNull String name, boolean value)
      通过完全限定名称设置权限为给定值.

      原文: Sets a permission to the given value, by its fully qualified name

      参数:
      name - 权限名称
      value - 权限的新值
    • setPermission

      public void setPermission(@NotNull @NotNull Permission perm, boolean value)
      设置权限为给定值.

      原文: Sets a permission to the given value

      参数:
      perm - 要设置的权限
      value - 权限的新值
    • unsetPermission

      public void unsetPermission(@NotNull @NotNull String name)
      从此附件中移除指定权限.

      如果此附件中不存在该权限, 什么也不会发生.

      原文: Removes the specified permission from this attachment.

      If the permission does not exist in this attachment, nothing will happen.

      参数:
      name - 要移除的权限名称
    • unsetPermission

      public void unsetPermission(@NotNull @NotNull Permission perm)
      从此附件中移除指定权限.

      如果此附件中不存在该权限, 什么也不会发生.

      原文: Removes the specified permission from this attachment.

      If the permission does not exist in this attachment, nothing will happen.

      参数:
      perm - 要移除的权限
    • remove

      public boolean remove()
      从此附件注册的Permissible中移除此附件.

      原文: Removes this attachment from its registered Permissible

      返回:
      如果可权限对象被成功移除返回true, 如果不存在返回false