Permissible, ServerOperatorpublic class PermissibleBase extends Object implements Permissible
| Constructor | Description |
|---|---|
PermissibleBase(@Nullable ServerOperator opable) |
| Modifier and Type | Method | Description |
|---|---|---|
@NotNull PermissionAttachment |
addAttachment(@NotNull Plugin plugin) |
Adds a new empty
PermissionAttachment to this object |
@Nullable PermissionAttachment |
addAttachment(@NotNull Plugin plugin,
int ticks) |
Temporarily adds a new empty
PermissionAttachment to this
object |
@NotNull PermissionAttachment |
addAttachment(@NotNull Plugin plugin,
@NotNull String name,
boolean value) |
Adds a new
PermissionAttachment with a single permission by
name and value |
@Nullable PermissionAttachment |
addAttachment(@NotNull Plugin plugin,
@NotNull String name,
boolean value,
int ticks) |
Temporarily adds a new
PermissionAttachment with a single
permission by name and value |
void |
clearPermissions() |
|
@NotNull Set<PermissionAttachmentInfo> |
getEffectivePermissions() |
Gets a set containing all of the permissions currently in effect by
this object
|
boolean |
hasPermission(@NotNull String inName) |
Gets the value of the specified permission, if set.
|
boolean |
hasPermission(@NotNull Permission perm) |
Gets the value of the specified permission, if set.
|
boolean |
isOp() |
Checks if this object is a server operator
|
boolean |
isPermissionSet(@NotNull String name) |
Checks if this object contains an override for the specified
permission, by fully qualified name
|
boolean |
isPermissionSet(@NotNull Permission perm) |
Checks if this object contains an override for the specified
Permission |
void |
recalculatePermissions() |
Recalculates the permissions for this object, if the attachments have
changed values.
|
void |
removeAttachment(@NotNull PermissionAttachment attachment) |
Removes the given
PermissionAttachment from this object |
void |
setOp(boolean value) |
Sets the operator status of this object
|
public PermissibleBase(@Nullable
@Nullable ServerOperator opable)
public boolean isOp()
ServerOperatorisOp in interface ServerOperatorpublic void setOp(boolean value)
ServerOperatorsetOp in interface ServerOperatorvalue - New operator valuepublic boolean isPermissionSet(@NotNull
@NotNull String name)
PermissibleisPermissionSet in interface Permissiblename - Name of the permissionpublic boolean isPermissionSet(@NotNull
@NotNull Permission perm)
PermissiblePermissionisPermissionSet in interface Permissibleperm - Permission to checkpublic boolean hasPermission(@NotNull
@NotNull String inName)
PermissibleIf a permission override is not set on this object, the default value of the permission will be returned.
hasPermission in interface PermissibleinName - Name of the permissionpublic boolean hasPermission(@NotNull
@NotNull Permission perm)
PermissibleIf a permission override is not set on this object, the default value of the permission will be returned
hasPermission in interface Permissibleperm - Permission to get@NotNull public @NotNull PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, boolean value)
PermissiblePermissionAttachment with a single permission by
name and valueaddAttachment in interface Permissibleplugin - Plugin responsible for this attachment, may not be null
or disabledname - Name of the permission to attachvalue - Value of the permission@NotNull public @NotNull PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin)
PermissiblePermissionAttachment to this objectaddAttachment in interface Permissibleplugin - Plugin responsible for this attachment, may not be null
or disabledpublic void removeAttachment(@NotNull
@NotNull PermissionAttachment attachment)
PermissiblePermissionAttachment from this objectremoveAttachment in interface Permissibleattachment - Attachment to removepublic void recalculatePermissions()
PermissibleThis should very rarely need to be called from a plugin.
recalculatePermissions in interface Permissiblepublic void clearPermissions()
@Nullable public @Nullable PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, boolean value, int ticks)
PermissiblePermissionAttachment with a single
permission by name and valueaddAttachment in interface Permissibleplugin - Plugin responsible for this attachment, may not be null
or disabledname - Name of the permission to attachvalue - Value of the permissionticks - Amount of ticks to automatically remove this attachment
after@Nullable public @Nullable PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, int ticks)
PermissiblePermissionAttachment to this
objectaddAttachment in interface Permissibleplugin - Plugin responsible for this attachment, may not be null
or disabledticks - Amount of ticks to automatically remove this attachment
after@NotNull public @NotNull Set<PermissionAttachmentInfo> getEffectivePermissions()
PermissiblegetEffectivePermissions in interface PermissibleCopyright © 2020. All rights reserved.