Package org.bukkit.permissions
Class PermissibleBase
- java.lang.Object
-
- org.bukkit.permissions.PermissibleBase
-
- All Implemented Interfaces:
Permissible,ServerOperator
public class PermissibleBase extends Object implements Permissible
Base Permissible for use in any Permissible object via proxy or extension
-
-
Constructor Summary
Constructors Constructor Description PermissibleBase(ServerOperator opable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PermissionAttachmentaddAttachment(Plugin plugin)Adds a new emptyPermissionAttachmentto this objectPermissionAttachmentaddAttachment(Plugin plugin, int ticks)Temporarily adds a new emptyPermissionAttachmentto this objectPermissionAttachmentaddAttachment(Plugin plugin, String name, boolean value)Adds a newPermissionAttachmentwith a single permission by name and valuePermissionAttachmentaddAttachment(Plugin plugin, String name, boolean value, int ticks)Temporarily adds a newPermissionAttachmentwith a single permission by name and valuevoidclearPermissions()Set<PermissionAttachmentInfo>getEffectivePermissions()Gets a set containing all of the permissions currently in effect by this objectbooleanhasPermission(String inName)Gets the value of the specified permission, if set.booleanhasPermission(Permission perm)Gets the value of the specified permission, if set.booleanisOp()Checks if this object is a server operatorbooleanisPermissionSet(String name)Checks if this object contains an override for the specified permission, by fully qualified namebooleanisPermissionSet(Permission perm)Checks if this object contains an override for the specifiedPermissionvoidrecalculatePermissions()Recalculates the permissions for this object, if the attachments have changed values.voidremoveAttachment(PermissionAttachment attachment)Removes the givenPermissionAttachmentfrom this objectvoidsetOp(boolean value)Sets the operator status of this object
-
-
-
Constructor Detail
-
PermissibleBase
public PermissibleBase(@Nullable ServerOperator opable)
-
-
Method Detail
-
isOp
public boolean isOp()
Description copied from interface:ServerOperatorChecks if this object is a server operator- Specified by:
isOpin interfaceServerOperator- Returns:
- true if this is an operator, otherwise false
-
setOp
public void setOp(boolean value)
Description copied from interface:ServerOperatorSets the operator status of this object- Specified by:
setOpin interfaceServerOperator- Parameters:
value- New operator value
-
isPermissionSet
public boolean isPermissionSet(@NotNull String name)Description copied from interface:PermissibleChecks if this object contains an override for the specified permission, by fully qualified name- Specified by:
isPermissionSetin interfacePermissible- Parameters:
name- Name of the permission- Returns:
- true if the permission is set, otherwise false
-
isPermissionSet
public boolean isPermissionSet(@NotNull Permission perm)Description copied from interface:PermissibleChecks if this object contains an override for the specifiedPermission- Specified by:
isPermissionSetin interfacePermissible- Parameters:
perm- Permission to check- Returns:
- true if the permission is set, otherwise false
-
hasPermission
public boolean hasPermission(@NotNull String inName)Description copied from interface:PermissibleGets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned.
- Specified by:
hasPermissionin interfacePermissible- Parameters:
inName- Name of the permission- Returns:
- Value of the permission
-
hasPermission
public boolean hasPermission(@NotNull Permission perm)Description copied from interface:PermissibleGets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned
- Specified by:
hasPermissionin interfacePermissible- Parameters:
perm- Permission to get- Returns:
- Value of the permission
-
addAttachment
@NotNull public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value)
Description copied from interface:PermissibleAdds a newPermissionAttachmentwith a single permission by name and value- Specified by:
addAttachmentin interfacePermissible- Parameters:
plugin- Plugin responsible for this attachment, may not be null or disabledname- Name of the permission to attachvalue- Value of the permission- Returns:
- The PermissionAttachment that was just created
-
addAttachment
@NotNull public PermissionAttachment addAttachment(@NotNull Plugin plugin)
Description copied from interface:PermissibleAdds a new emptyPermissionAttachmentto this object- Specified by:
addAttachmentin interfacePermissible- Parameters:
plugin- Plugin responsible for this attachment, may not be null or disabled- Returns:
- The PermissionAttachment that was just created
-
removeAttachment
public void removeAttachment(@NotNull PermissionAttachment attachment)Description copied from interface:PermissibleRemoves the givenPermissionAttachmentfrom this object- Specified by:
removeAttachmentin interfacePermissible- Parameters:
attachment- Attachment to remove
-
recalculatePermissions
public void recalculatePermissions()
Description copied from interface:PermissibleRecalculates the permissions for this object, if the attachments have changed values.This should very rarely need to be called from a plugin.
- Specified by:
recalculatePermissionsin interfacePermissible
-
clearPermissions
public void clearPermissions()
-
addAttachment
@Nullable public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks)
Description copied from interface:PermissibleTemporarily adds a newPermissionAttachmentwith a single permission by name and value- Specified by:
addAttachmentin interfacePermissible- Parameters:
plugin- 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- Returns:
- The PermissionAttachment that was just created
-
addAttachment
@Nullable public PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks)
Description copied from interface:PermissibleTemporarily adds a new emptyPermissionAttachmentto this object- Specified by:
addAttachmentin interfacePermissible- Parameters:
plugin- Plugin responsible for this attachment, may not be null or disabledticks- Amount of ticks to automatically remove this attachment after- Returns:
- The PermissionAttachment that was just created
-
getEffectivePermissions
@NotNull public Set<PermissionAttachmentInfo> getEffectivePermissions()
Description copied from interface:PermissibleGets a set containing all of the permissions currently in effect by this object- Specified by:
getEffectivePermissionsin interfacePermissible- Returns:
- Set of currently effective permissions
-
-