Package org.bukkit.permissions
Interface Permissible
- All Superinterfaces:
ServerOperator
- All Known Subinterfaces:
Ageable,Ambient,Animals,ArmorStand,Arrow,Bat,Blaze,BlockCommandSender,Boat,CaveSpider,Chicken,CommandMinecart,CommandSender,ComplexEntityPart,ComplexLivingEntity,ConsoleCommandSender,Cow,Creature,Creeper,Damageable,Egg,EnderCrystal,EnderDragon,EnderDragonPart,Enderman,Endermite,EnderPearl,EnderSignal,Entity,ExperienceOrb,Explosive,ExplosiveMinecart,FallingBlock,FallingSand,Fireball,Firework,Fish,FishHook,Flying,Ghast,Giant,Golem,Guardian,Hanging,HopperMinecart,Horse,HumanEntity,IronGolem,Item,ItemFrame,LargeFireball,LeashHitch,LightningStrike,LivingEntity,MagmaCube,Minecart,Monster,MushroomCow,NPC,Ocelot,Painting,Pig,PigZombie,Player,PoweredMinecart,PoweredMinecart,Projectile,ProxiedCommandSender,Rabbit,RemoteConsoleCommandSender,RideableMinecart,Sheep,Silverfish,Skeleton,Slime,SmallFireball,Snowball,Snowman,SpawnerMinecart,Spider,Squid,StorageMinecart,StorageMinecart,ThrownExpBottle,ThrownPotion,TNTPrimed,Vehicle,Villager,WaterMob,Weather,Witch,Wither,WitherSkull,Wolf,Zombie
- All Known Implementing Classes:
PermissibleBase
public interface Permissible extends ServerOperator
Represents an object that may be assigned permissions
-
Method Summary
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, java.lang.String name, boolean value)Adds a newPermissionAttachmentwith a single permission by name and valuePermissionAttachmentaddAttachment(Plugin plugin, java.lang.String name, boolean value, int ticks)Temporarily adds a newPermissionAttachmentwith a single permission by name and valuejava.util.Set<PermissionAttachmentInfo>getEffectivePermissions()Gets a set containing all of the permissions currently in effect by this objectbooleanhasPermission(java.lang.String name)Gets the value of the specified permission, if set.booleanhasPermission(Permission perm)Gets the value of the specified permission, if set.booleanisPermissionSet(java.lang.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 object
-
Method Details
-
isPermissionSet
boolean isPermissionSet(java.lang.String name)Checks if this object contains an override for the specified permission, by fully qualified name- Parameters:
name- Name of the permission- Returns:
- true if the permission is set, otherwise false
-
isPermissionSet
Checks if this object contains an override for the specifiedPermission- Parameters:
perm- Permission to check- Returns:
- true if the permission is set, otherwise false
-
hasPermission
boolean hasPermission(java.lang.String name)Gets 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.
- Parameters:
name- Name of the permission- Returns:
- Value of the permission
-
hasPermission
Gets 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
- Parameters:
perm- Permission to get- Returns:
- Value of the permission
-
addAttachment
Adds a newPermissionAttachmentwith a single permission by name and value- 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
Adds a new emptyPermissionAttachmentto this object- Parameters:
plugin- Plugin responsible for this attachment, may not be null or disabled- Returns:
- The PermissionAttachment that was just created
-
addAttachment
Temporarily adds a newPermissionAttachmentwith a single permission by name and value- 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
Temporarily adds a new emptyPermissionAttachmentto this object- 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
-
removeAttachment
Removes the givenPermissionAttachmentfrom this object- Parameters:
attachment- Attachment to remove- Throws:
java.lang.IllegalArgumentException- Thrown when the specified attachment isn't part of this object
-
recalculatePermissions
void recalculatePermissions()Recalculates the permissions for this object, if the attachments have changed values.This should very rarely need to be called from a plugin.
-
getEffectivePermissions
java.util.Set<PermissionAttachmentInfo> getEffectivePermissions()Gets a set containing all of the permissions currently in effect by this object- Returns:
- Set of currently effective permissions
-