Interface Protection
- All Superinterfaces:
Nameable,ProtectionHookHolder,com.github.angeschossen.pluginframework.api.trusted.RoleHolder
- All Known Subinterfaces:
BlockProtection,EntityProtection
public interface Protection
extends Nameable, com.github.angeschossen.pluginframework.api.trusted.RoleHolder, ProtectionHookHolder
Represents a protection on a block or entity, owned by a player.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(@Nullable ProtectPlayer deleter) Delete the protection and send the unlock message to the deleter.voiddelete(@Nullable ProtectPlayer deleter, boolean msg) Delete the protection.@Nullable com.github.angeschossen.pluginframework.api.trusted.group.GroupgetGroup()Get group that this protection belongs to.@NotNull ProtectionTypeGet the type of protection.@NotNull Collection<UUID> Get players that are trusted directly to this protection and aren't trusted via a groupGroup.intgetX()Get the block x coordinate.intgetY()Get the block y coordinate.intgetZ()Get the block z coordinate.booleanhasFlag(@NotNull ProtectionFlag flag) Check if a protection has a flag set.booleantoggleFlag(@NotNull ProtectionFlag flag) Toggle a flag for this protection.@NotNull Typetype()Get the type of protection.booleanuntrustPlayer(@NotNull UUID playerUUID) Untrust a player that is trusted directly to this protection.Methods inherited from interface me.angeschossen.chestprotect.api.protection.Nameable
getDisplayName, getNameMethods inherited from interface me.angeschossen.chestprotect.api.protection.hook.ProtectionHookHolder
getId, getProtectionHookData, getRegisteredProtectionHook, getWorld, removeProtectionHook, setProtectionHookMethods inherited from interface com.github.angeschossen.pluginframework.api.trusted.RoleHolder
getDisplayName, getName, getOwner, getOwnerName, getRole, getTrusted, isAllowRegionMembers, isTrusted, openMenu, setAllowRegionMembers, setName, setOwner, setRole, trustPlayer
-
Method Details
-
getProtectionType
Get the type of protection.- Returns:
- block or entity
-
getX
int getX()Get the block x coordinate.- Specified by:
getXin interfaceProtectionHookHolder- Returns:
- block x
-
getY
int getY()Get the block y coordinate.- Specified by:
getYin interfaceProtectionHookHolder- Returns:
- block y
-
getZ
int getZ()Get the block z coordinate.- Specified by:
getZin interfaceProtectionHookHolder- Returns:
- block z
-
type
Get the type of protection.- Returns:
- protection type
-
getGroup
@Nullable @Nullable com.github.angeschossen.pluginframework.api.trusted.group.Group getGroup()Get group that this protection belongs to.- Returns:
- null, if no group set
-
delete
Delete the protection.- Parameters:
deleter- The player that deletes the protection, will receive an unlock message.msg- whether to send the unlock message to the deleter- Throws:
IllegalStateException
-
delete
Delete the protection and send the unlock message to the deleter.- Parameters:
deleter- the player that deletes the protection, will receive an unlock message- Throws:
IllegalStateException
-
getTrustedWithoutGroup
Get players that are trusted directly to this protection and aren't trusted via a groupGroup.- Returns:
- Players directly trusted at this protection
-
hasFlag
Check if a protection has a flag set.- Parameters:
flag- the flag- Returns:
- false, if flag not set
-
toggleFlag
Toggle a flag for this protection.- Parameters:
flag- the flag to toggle- Returns:
- new state of the flag
-
untrustPlayer
Untrust a player that is trusted directly to this protection.- Specified by:
untrustPlayerin interfacecom.github.angeschossen.pluginframework.api.trusted.RoleHolder- Parameters:
playerUUID- The player to untrust
-