Package com.griefdefender.api.claim
Interface Claim
- All Superinterfaces:
ContextSource
- All Known Subinterfaces:
Town
Represents a protected claim.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(ClaimAttribute attribute) Adds aClaimAttribute.addClanTrust(Clan clan, TrustType type) Grants claim trust to the clan for givenTrustType.addClanTrust(String clanTag, TrustType type) Grants claim trust to the clan for givenTrustType.addClanTrusts(Set<Clan> clans, TrustType type) Grants claim trust to the set of clans for givenTrustType.addGroupTrust(String group, TrustType type) Grants claim trust to the group for givenTrustType.addGroupTrusts(Set<String> groups, TrustType type) Grants claim trust to the set of groups for givenTrustType.addUserTrust(UUID uuid, TrustType type) Grants claim trust to the UUID for givenTrustType.addUserTrusts(Set<UUID> uuid, TrustType type) Grants claim trust to the set of UUID's for givenTrustType.booleanWhether user withUUIDcan edit claim.static Claim.Builderbuilder()Gets a new claim builder instance forClaim.Builder.booleanChecks if a block can be broken at specified location in thisClaim.booleancanHurtEntity(Object source, Object itemStack, Object entity, @Nullable User user) Checks if an entity can be attacked in thisClaim.booleancanInteractWithEntity(Object source, Object itemStack, Object entity, @Nullable User user, TrustType trustType) Checks if an entity can be interacted with in thisClaim.booleanChecks if a block can be placed at specified location in thisClaim.default booleancanUseBlock(Object source, Object location, @Nullable User user, TrustType trustType) Checks if a block can be used at specified location.booleancanUseBlock(Object source, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift) Checks if a block can be used at specified location.default booleancanUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType) Checks if this player can use item at a specified location.booleancanUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift) Checks if this player can use item at a specified location.default ClaimResultchangeType(ClaimType type) Attempts to change claim to another type.changeType(ClaimType type, @Nullable UUID owner) Attempts to change claim to another type and owner.default booleancontains(int x, int y, int z) Checks if the position is within this claim.booleancontains(int x, int y, int z, boolean excludeChildren) Checks if the position is within this claim.default booleancontains(com.flowpowered.math.vector.Vector3i pos) Checks if the position is within this claim.default booleancontains(com.flowpowered.math.vector.Vector3i pos, boolean excludeChildren) Checks if the position is within this claim.createSnapshot(String name, boolean includeChildren) Creates aClaimSnapshot.createSnapshot(String name, net.kyori.adventure.text.Component description, boolean includeChildren) Creates aClaimSnapshot.createSnapshot(String name, net.kyori.adventure.text.Component description, SnapshotCreateSettings settings) Creates aClaimSnapshot.deleteChild(Claim child) Deletes a child claim.Deletes all children claims.deleteChildren(ClaimType type) Deletes all children claims of a specificClaimType.booleandeleteSchematic(String schematic) Deletes the specifiedClaimSchematicif it exists.booleandeleteSnapshot(String name) Deletes the specifiedClaimSnapshotif it exists.booleanextend(int newDepth) Extends a cuboid claim downward.default TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts) default TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, boolean checkOverride) default TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, TrustType type, boolean checkOverride) default TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts) default TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, boolean checkOverride) default Tristatedefault TristategetActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, TrustType type, boolean checkOverride) default StringgetActiveOptionDefinitionValue(OptionDefinition definition) Gets the activeOptionDefinitionvalue in thisClaim.getActiveOptionDefinitionValue(Subject subject, OptionDefinition definition) Gets the activeOptionDefinitionvalue in thisClaim.default <T> TgetActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Subject subject, Set<Context> contexts) default <T> TgetActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Set<Context> contexts) intgetArea()Gets the total claim area in blocks.Gets a set ofClaimAttribute's associated with claim.getChildren(boolean recursive) Gets an immutable list of child claims.Gets the chunk hashes this claim contains.List<com.flowpowered.math.vector.Vector3i> Gets the list of chunk positions used by this claim.intGets the claim blocks required for this claim.@Nullable ClaimGroupGets the claim group this claim is associated with.Gets theClaimManagerof this claim's world.@Nullable ClaimVisualGets the activeClaimVisual.Gets an unmodifiable set of all trusted clans.getClanTrusts(TrustType type) Gets an unmodifiable set of trusted clans forTrustType.getData()Gets the persisted data of claim.Gets the default context which is used for storing flag defaults.@Nullable StringGets the claim's display name.Optional<net.kyori.adventure.text.Component> Gets the claim's display nameComponent.@Nullable UUIDGets the economy account used for claim bank.default EconomyDatadefault TristategetFlagPermissionValue(Flag flag, Set<Context> contexts) @Nullable StringGets the unique friendly identifier of claim.com.flowpowered.math.vector.Vector3iGets the greater boundary corner of claim.Gets an unmodifiable set of all trusted groups.getGroupTrusts(TrustType type) Gets an unmodifiable set of trusted groups forTrustType.intGets the claim's height(y axis) in blocks.intGets the claim's length(z axis) in blocks.com.flowpowered.math.vector.Vector3iGets the lesser boundary corner of claim.getOptionValue(Option<?> option, Subject subject, Set<Context> contexts) default StringgetOptionValue(Option<?> option, Set<Context> contexts) Gets the override context which is used for overriding claim flags.net.kyori.adventure.text.ComponentGets the claim owner's display name as aComponent.Gets the claim owner's name.default UUIDGets the claim owner'sUUID.@Nullable ClaimGets the claim's parent.getParents(boolean recursive) Gets an immutable list of parent claims.Gets the list of players currently in claim.@Nullable ClaimGets the rented claim.Gets a map of currently storedClaimSchematic's.Gets a map of currently storedClaimSnapshot's.@Nullable ClaimgetTown()Gets the town this claim is in.default ClaimTypegetType()Gets theClaimTypeof claim.Gets theUUIDof claim.Gets an unmodifiable set of all trusted users.getUserTrusts(TrustType type) Gets an unmodifiable set of trusted users forTrustType.intGets the total claim volume in blocks.intgetWidth()Gets the claim's width(x axis) in blocks.Gets the wilderness claim of this claim's world.Gets the claim's world name.default UUIDGets the claim's worldUUID.booleanhasActiveVisual(User user) default booleanhasAttribute(ClaimAttribute attribute) Checks if claim containsClaimAttribute.booleanhasAttribute(String id) Checks if claim containsClaimAttributeby id.default booleanChecks if this type isClaimTypes.ADMIN.default booleanChecks if this type isClaimTypes.BASIC.booleanisClanTrusted(Clan clan, TrustType type) Checks if the clan is trusted with givenTrustType.booleanisClanTrusted(String clanTag, TrustType type) Checks if the clan tag is trusted with givenTrustType.booleanisCuboid()Gets whether claim is a cuboid.booleanisGroupTrusted(String group, TrustType type) Checks if the group is trusted with givenTrustType.booleanChecks if this claim is within another claim.booleanisInTown()Checks if this claim is within a town.booleanChecks if claim is parentdefault booleanisPlot()Checks if this type isClaimTypes.PLOT.booleanWhether PVP is allowed in thisClaim.default booleanChecks if this type isClaimTypes.SUBDIVISION.default booleanisTown()Checks if this type isClaimTypes.TOWN.booleanisUserTrusted(UUID uuid, TrustType type) default booleanChecks if this type isClaimTypes.WILDERNESS.booleanChecks if this claim overlaps another.voidRemoves all attribute types associated with claim.Clears all clan trusts for claim.Clears all group trusts for claim.Clears all trusts for claim.Clears all user trusts for claim.default voidremoveAttribute(ClaimAttribute attribute) Removes aClaimAttribute.voidRemoves aClaimAttributeby id.removeClanTrust(Clan clan, TrustType type) Removes a clan from claim trust for givenTrustType.removeClanTrust(String clanTag, TrustType type) Removes a clan from claim trust for givenTrustType.removeClanTrusts(Set<Clan> clans, TrustType type) Removes the set of clans from claim trust for givenTrustType.removeGroupTrust(String group, TrustType type) Removes a group from claim trust for givenTrustType.removeGroupTrusts(Set<String> groups, TrustType type) Removes the set of UUID's from claim trust for givenTrustType.removeUserTrust(UUID uuid, TrustType type) Removes UUID from claim trust for givenTrustType.removeUserTrusts(Set<UUID> uuid, TrustType type) Removes the set of UUID's from claim trust for givenTrustType.resize(int x1, int x2, int y1, int y2, int z1, int z2) Resizes the claim.default ClaimResultresize(com.flowpowered.math.vector.Vector3i startCornerPos, com.flowpowered.math.vector.Vector3i endCornerPos) Resizes a claim.default CompletableFuture<PermissionResult> setFlagDefinition(FlagDefinition definition, Tristate value) SetFlagDefinitionin thisClaim.setFlagDefinition(Subject subject, FlagDefinition definition, Tristate value) default CompletableFuture<PermissionResult> default CompletableFuture<PermissionResult> setFlagPermission(Flag flag, Tristate value, Set<Context> contexts) voidsetFriendlyIdentifier(String name) Sets the unique friendly identifier of claim.default CompletableFuture<PermissionResult> default CompletableFuture<PermissionResult> default CompletableFuture<PermissionResult> setOptionDefinition(OptionDefinition definition, String value) SetOptionDefinitionin thisClaim.setOptionDefinition(Subject subject, OptionDefinition definition, String value) transferOwner(UUID ownerUniqueId) Transfers claim to new owner.Methods inherited from interface com.griefdefender.api.ContextSource
getContext
-
Method Details
-
getUniqueId
UUID getUniqueId()Gets theUUIDof claim.- Returns:
- The UUID of this claim
-
getType
Gets theClaimTypeof claim.- Returns:
- The claim type
-
getWorldUniqueId
Gets the claim's worldUUID.- Returns:
- The world UUID
-
getWorldName
String getWorldName()Gets the claim's world name.- Returns:
- The world name
-
getDisplayNameComponent
Optional<net.kyori.adventure.text.Component> getDisplayNameComponent()Gets the claim's display nameComponent.- Returns:
- The display name component, if available
-
getDisplayName
@Nullable String getDisplayName()Gets the claim's display name.- Returns:
- The display name, if available
-
getFriendlyIdentifier
@Nullable String getFriendlyIdentifier()Gets the unique friendly identifier of claim. Note: This represents the unique friendly identifier of claim and is different from thegetDisplayName().- Returns:
- The unique friendly identifier, if available
-
getClaimGroup
@Nullable ClaimGroup getClaimGroup()Gets the claim group this claim is associated with.- Returns:
- The claim group, if available
-
setFriendlyIdentifier
Sets the unique friendly identifier of claim. Note: This represents the unique friendly identifier of claim and is different from the.invalid reference
#setDisplayName(Component)- Parameters:
name- The unique friendly identifierreplace- Whether to replace if identifier exists
-
getClaimVisual
@Nullable ClaimVisual getClaimVisual()Gets the activeClaimVisual.- Returns:
- The claim visual, if available
-
getOwnerName
String getOwnerName()Gets the claim owner's name. Note:andinvalid reference
ClaimType#ADMINclaims do not have owners. These claims should return a general name such as 'administrator'.invalid reference
ClaimType#WILDERNESS- Returns:
- The name of claim owner
-
getOwnerDisplayName
net.kyori.adventure.text.Component getOwnerDisplayName()Gets the claim owner's display name as aComponent. Note:andinvalid reference
ClaimType#ADMINclaims do not have owners. These claims should return a general name such as 'administrator'.invalid reference
ClaimType#WILDERNESS- Returns:
- The display name of claim owner, if available
-
getOwnerUniqueId
Gets the claim owner'sUUID. Note:andinvalid reference
ClaimType#ADMINclaims do not have owners.invalid reference
ClaimType#WILDERNESS- Returns:
- The UUID of this claim
-
addAttribute
Adds aClaimAttribute.- Parameters:
attribute- The claim attribute
-
removeAttribute
Removes aClaimAttribute.- Parameters:
id- The claim attribute
-
removeAttribute
Removes aClaimAttributeby id.- Parameters:
id- The claim attribute id
-
removeAllAttributes
void removeAllAttributes()Removes all attribute types associated with claim. -
hasAttribute
Checks if claim containsClaimAttribute.- Parameters:
attribute- The claim attribute- Returns:
- true if claim contains it, false if not
-
hasAttribute
Checks if claim containsClaimAttributeby id.- Parameters:
id- The claim attribute id- Returns:
- true if claim contains it, false if not
-
getAttributes
Set<ClaimAttribute> getAttributes()Gets a set ofClaimAttribute's associated with claim.- Returns:
- An unmodifiable set of claim attributes
-
getParent
@Nullable Claim getParent()Gets the claim's parent.- Returns:
- The parent claim, if available
-
getInheritedParents
-
getLesserBoundaryCorner
com.flowpowered.math.vector.Vector3i getLesserBoundaryCorner()Gets the lesser boundary corner of claim.- Returns:
- The lesser boundary corner location.
-
getGreaterBoundaryCorner
com.flowpowered.math.vector.Vector3i getGreaterBoundaryCorner()Gets the greater boundary corner of claim.- Returns:
- The greater boundary corner location.
-
isCuboid
boolean isCuboid()Gets whether claim is a cuboid.- Returns:
- true if claim is cuboid
-
isParent
Checks if claim is parent- Parameters:
claim- The claim to check- Returns:
- true if claim is parent
-
getClaimBlocks
int getClaimBlocks()Gets the claim blocks required for this claim. Note: If cuboids are enabled in wilderness, 2D claims will factor in Y.- Returns:
- The claim blocks of claim
-
getArea
int getArea()Gets the total claim area in blocks.- Returns:
- The total area of claim
-
getVolume
int getVolume()Gets the total claim volume in blocks.- Returns:
- The total volume of claim
-
getWidth
int getWidth()Gets the claim's width(x axis) in blocks.- Returns:
- The width of claim
-
getHeight
int getHeight()Gets the claim's height(y axis) in blocks.- Returns:
- The height of claim
-
getLength
int getLength()Gets the claim's length(z axis) in blocks.- Returns:
- The length of claim
-
getChunkPositions
List<com.flowpowered.math.vector.Vector3i> getChunkPositions()Gets the list of chunk positions used by this claim.- Returns:
- The list of claim chunk positions used.
-
getPlayers
Gets the list of players currently in claim.- Returns:
- The list of players in claim.
-
transferOwner
Transfers claim to new owner. Note: Bothandinvalid reference
ClaimType#WILDERNESScannot be transferred. This validates if the new owner has enough claim blocks to support this claim.invalid reference
ClaimType#ADMIN- Parameters:
ownerUniqueId-- Returns:
- The claim result
-
changeType
Attempts to change claim to another type. Note: If changing anclaim, owner is required.invalid reference
ClaimType#ADMIN- Parameters:
type- The new claim type- Returns:
- The claim result
-
changeType
Attempts to change claim to another type and owner. Note:cannot be changed. If changing aninvalid reference
ClaimType#WILDERNESSclaim, owner is required.invalid reference
ClaimType#ADMIN- Parameters:
type- The new claim typeowner- The owner to set- Returns:
- The claim result
-
resize
default ClaimResult resize(com.flowpowered.math.vector.Vector3i startCornerPos, com.flowpowered.math.vector.Vector3i endCornerPos) Resizes a claim.- Parameters:
startCornerPos- The start corner block positionendCornerPos- The end corner block position- Returns:
- The claim result
-
resize
Resizes the claim.- Parameters:
x1- The start X-axis positionx2- The end X-axis positiony1- The start Y-axis positiony2- The end Y-axis positionz1- The start Z-axis positionz2- The end Z-axis position- Returns:
- The claim result
-
getChildren
Gets an immutable list of child claims. Note: This will return an empty list if no child claims are found.- Parameters:
recursive- Whether to recursively scan for children- Returns:
- The immutable list of child claims
-
getParents
Gets an immutable list of parent claims. Note: This will return an empty list if no parent claims are found.- Parameters:
recursive- Whether to recursively scan for parents- Returns:
- The immutable list of parent claims
-
getUserTrusts
Gets an unmodifiable set of all trusted users.- Returns:
- An unmodifiable set of all trusted users
-
getUserTrusts
Gets an unmodifiable set of trusted users forTrustType.- Returns:
- An unmodifiable set of trusted users
-
getGroupTrusts
Gets an unmodifiable set of all trusted groups.- Returns:
- An unmodifiable set of all trusted groups
-
getGroupTrusts
Gets an unmodifiable set of trusted groups forTrustType.- Returns:
- An unmodifiable set of trusted groups
-
removeAllTrusts
ClaimResult removeAllTrusts()Clears all trusts for claim.- Returns:
- The claim result
-
removeAllUserTrusts
ClaimResult removeAllUserTrusts()Clears all user trusts for claim.- Returns:
- The claim result
-
removeAllGroupTrusts
ClaimResult removeAllGroupTrusts()Clears all group trusts for claim.- Returns:
- The claim result
-
getClanTrusts
Gets an unmodifiable set of all trusted clans.- Returns:
- An unmodifiable set of all trusted clans
-
getClanTrusts
Gets an unmodifiable set of trusted clans forTrustType.- Returns:
- An unmodifiable set of trusted clans
-
removeAllClanTrusts
ClaimResult removeAllClanTrusts()Clears all clan trusts for claim.- Returns:
- The claim result
-
addUserTrust
Grants claim trust to the UUID for givenTrustType.- Parameters:
uuid- The UUID of usertype- The trust type- Returns:
- The claim result
-
addUserTrusts
Grants claim trust to the set of UUID's for givenTrustType.- Parameters:
uuid- The set of user UUID'stype- The trust type- Returns:
- The claim result
-
removeUserTrust
Removes UUID from claim trust for givenTrustType.- Parameters:
uuid- The UUID of usertype- The trust type- Returns:
- The claim result
-
removeUserTrusts
Removes the set of UUID's from claim trust for givenTrustType.- Parameters:
uuid- The set of user UUID'stype- The trust type- Returns:
- The claim result
-
addGroupTrust
Grants claim trust to the group for givenTrustType.- Parameters:
group- The grouptype- The trust type- Returns:
- The claim result
-
addGroupTrusts
Grants claim trust to the set of groups for givenTrustType.- Parameters:
groups- The set of groupstype- The trust type- Returns:
- The claim result
-
removeGroupTrust
Removes a group from claim trust for givenTrustType.- Parameters:
group- The grouptype- The trust type- Returns:
- The claim result
-
removeGroupTrusts
Removes the set of UUID's from claim trust for givenTrustType.- Parameters:
groups- The set of groupstype- The trust type- Returns:
- The claim result
-
addClanTrust
Grants claim trust to the clan for givenTrustType.- Parameters:
clan- The clantype- The trust type- Returns:
- The claim result
-
addClanTrusts
Grants claim trust to the set of clans for givenTrustType.- Parameters:
clans- The set of clanstype- The trust type- Returns:
- The claim result
-
addClanTrust
Grants claim trust to the clan for givenTrustType.- Parameters:
clanTag- The clan tagtype- The trust type- Returns:
- The claim result
-
removeClanTrust
Removes a clan from claim trust for givenTrustType.- Parameters:
clan- The clantype- The trust type- Returns:
- The claim result
-
removeClanTrust
Removes a clan from claim trust for givenTrustType.- Parameters:
clanTag- The clan tagtype- The trust type- Returns:
- The claim result
-
removeClanTrusts
Removes the set of clans from claim trust for givenTrustType.- Parameters:
clans- The set of clanstype- The trust type- Returns:
- The claim result
-
isUserTrusted
- Parameters:
uuid- The uuid to checktype- The minimum trust required- Returns:
- Whether the uuid is trusted
-
isGroupTrusted
Checks if the group is trusted with givenTrustType.- Parameters:
group- The group to checktype- The minimum trust required- Returns:
- Whether the group is trusted
-
isClanTrusted
Checks if the clan is trusted with givenTrustType.- Parameters:
clan- The clan to checktype- The minimum trust required- Returns:
- Whether the clan is trusted
-
isClanTrusted
Checks if the clan tag is trusted with givenTrustType.- Parameters:
clanTag- The clan tag to checktype- The minimum trust required- Returns:
- Whether the clan is trusted
-
isAdminClaim
default boolean isAdminClaim()Checks if this type isClaimTypes.ADMIN.- Returns:
- true if admin claim
-
isBasicClaim
default boolean isBasicClaim()Checks if this type isClaimTypes.BASIC.- Returns:
- true if basic claim
-
isPlot
default boolean isPlot()Checks if this type isClaimTypes.PLOT.- Returns:
- true if plot
-
isSubdivision
default boolean isSubdivision()Checks if this type isClaimTypes.SUBDIVISION.- Returns:
- true if subdivision
-
isTown
default boolean isTown()Checks if this type isClaimTypes.TOWN.- Returns:
- true if town
-
isWilderness
default boolean isWilderness()Checks if this type isClaimTypes.WILDERNESS.- Returns:
- true if wilderness
-
isInTown
boolean isInTown()Checks if this claim is within a town.- Returns:
- true if this claim is within a town
-
getTown
@Nullable Claim getTown()Gets the town this claim is in.- Returns:
- the town this claim is in, if any
-
getClaimManager
ClaimManager getClaimManager()Gets theClaimManagerof this claim's world.- Returns:
- The claim manager
-
getWilderness
Claim getWilderness()Gets the wilderness claim of this claim's world.- Returns:
- The wilderness claim
-
contains
default boolean contains(int x, int y, int z) Checks if the position is within this claim.- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate- Returns:
- Whether this claim contains the passed position
-
contains
default boolean contains(com.flowpowered.math.vector.Vector3i pos) Checks if the position is within this claim.- Parameters:
location-- Returns:
- Whether this claim contains the passed position
-
contains
default boolean contains(com.flowpowered.math.vector.Vector3i pos, boolean excludeChildren) Checks if the position is within this claim.- Parameters:
excludeChildren-location-- Returns:
- Whether this claim contains the passed location
-
contains
boolean contains(int x, int y, int z, boolean excludeChildren) Checks if the position is within this claim.- Parameters:
x- X coordinatey- Y coordinatez- Z coordinateexcludeChildren-- Returns:
- Whether this claim contains the passed location
-
overlaps
Checks if this claim overlaps another.- Parameters:
otherClaim- The other claim to check- Returns:
- Whether this claim overlaps the other claim
-
extend
boolean extend(int newDepth) Extends a cuboid claim downward.- Parameters:
newDepth- The new depth- Returns:
- Whether the extension was successful
-
isInside
Checks if this claim is within another claim.- Parameters:
otherClaim- The other claim- Returns:
- Whether this claim is inside other claim
-
getChunkHashes
Gets the chunk hashes this claim contains.- Returns:
- The set of chunk hashes
-
deleteChildren
ClaimResult deleteChildren()Deletes all children claims.- Returns:
- The result of deletion
-
deleteChildren
Deletes all children claims of a specificClaimType.- Parameters:
type- The type of claims to delete- Returns:
- The result of deletion
-
deleteChild
Deletes a child claim.- Parameters:
child- The child claim to be deleted- Returns:
- The result of deletion
-
getData
ClaimData getData()Gets the persisted data of claim.- Returns:
- The claim's persisted data
-
deleteSchematic
Deletes the specifiedClaimSchematicif it exists.- Parameters:
name- The schematic to delete- Returns:
- true if the schematic was deleted
-
getSchematics
Map<String,ClaimSchematic> getSchematics()Gets a map of currently storedClaimSchematic's.- Returns:
- The map of schematics, empty if none
-
createSnapshot
ClaimSnapshot createSnapshot(String name, net.kyori.adventure.text.Component description, SnapshotCreateSettings settings) Creates aClaimSnapshot.- Parameters:
name- The snapshot namedescription- The snapshot descriptionsettings- The creation settings- Returns:
- The claim snapshot
-
createSnapshot
Creates aClaimSnapshot. Note: This will use defaultSnapshotCreateSettings- Parameters:
name- The snapshot nameincludeChildren- True to include children, false if not- Returns:
- The claim snapshot
-
createSnapshot
ClaimSnapshot createSnapshot(String name, net.kyori.adventure.text.Component description, boolean includeChildren) Creates aClaimSnapshot. Note: This will use defaultSnapshotCreateSettings- Parameters:
name- The snapshot namedescription- The snapshot descriptionincludeChildren- True to include children, false if not- Returns:
- The claim snapshot
-
deleteSnapshot
Deletes the specifiedClaimSnapshotif it exists.- Parameters:
name- The snapshot to delete- Returns:
- true if the snapshot was deleted
-
getSnapshots
Map<String,ClaimSnapshot> getSnapshots()Gets a map of currently storedClaimSnapshot's.- Returns:
- The map of snapshots, empty if none
-
getEconomyData
-
getEconomyAccountId
@Nullable UUID getEconomyAccountId()Gets the economy account used for claim bank.- Returns:
- the economy account, if available
-
getRentedClaim
@Nullable Claim getRentedClaim()Gets the rented claim. Note: If this is a non-rented child claim, it will check parents that have same owner.- Returns:
- The rented claim
-
hasActiveVisual
- Parameters:
user- The user- Returns:
- true if active visual, false if not
-
isPvpAllowed
boolean isPvpAllowed()Whether PVP is allowed in thisClaim.- Returns:
- true if allowed, false if not
-
allowEdit
Whether user withUUIDcan edit claim.- Parameters:
uuid- The user unique id- Returns:
- true if allowed, false if not
-
canBreak
Checks if a block can be broken at specified location in thisClaim.
Note: If source was performed directly by player, pass player
Note: If source is custom, pass a string identifier in format 'modid:name'- Parameters:
source- The source performing the break actionlocation- The target block locationuser- The user associated with action, if available- Returns:
- true if block can be broken, false if not
-
canPlace
Checks if a block can be placed at specified location in thisClaim.
Note: If source was performed directly by player, pass player
Note: If source or item is custom, pass a string identifier in format 'modid:name'- Parameters:
source- The source performing the place actionplacedItem- The item being placedlocation- The target block locationuser- The user associated with action, if available- Returns:
- true if block can be placed, false if not
-
canHurtEntity
Checks if an entity can be attacked in thisClaim.
Note: If source was performed directly by player, pass player
Note: If source or item is custom, pass a string identifier in format 'modid:name'- Parameters:
source- The source performing the attackitemStack- The item being used to attack entityentity- The target entityuser- The user associated with action, if available- Returns:
- true if entity can be attacked, false if not
-
canInteractWithEntity
boolean canInteractWithEntity(Object source, Object itemStack, Object entity, @Nullable User user, TrustType trustType) Checks if an entity can be interacted with in thisClaim.
Note: If source was performed directly by player, pass player
Note: If source, item, or entity is custom, pass a string identifier in format 'modid:name'- Parameters:
source- The source performing the entity interactionitemStack- The item being used to interact with entityentity- The target entityuser- The user associated with action, if availabletrustType- The minimumTrustTyperequired- Returns:
- true if entity can be interacted with, false if not
-
canUseBlock
default boolean canUseBlock(Object source, Object location, @Nullable User user, TrustType trustType) Checks if a block can be used at specified location.
Note: If source was performed directly by player, pass player
Note: If source is custom, pass a string identifier in format 'modid:name'- Parameters:
source- The source performing the use actionlocation- The target block locationuser- The user associated with action, if availabletrustType- The minimumTrustTyperequired- Returns:
- true if block can be used, false if not
-
canUseBlock
boolean canUseBlock(Object source, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift) Checks if a block can be used at specified location.
Note: If source was performed directly by player, pass player
Note: If source is custom, pass a string identifier in format 'modid:name'
Note: Parameters 'leftClick' and 'shift' are only used if player is source.- Parameters:
source- The source performing the use actionlocation- The target block locationuser- The user associated with action, if availabletrustType- The minimumTrustTyperequiredleftClick- If block will be activated on left-clickshift- If block activation requires shift- Returns:
- true if block can be used, false if not
-
canUseItem
default boolean canUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType) Checks if this player can use item at a specified location.
Note: If source was performed directly by player, pass player
Note: If source or item is custom, pass a string identifier in format 'modid:name'
Note: If item is activated on right-click then 'leftClick' should be false.- Parameters:
source- The source performing the use actionitemStack- The target itemStacklocation- The location where item will be useduser- The user associated with action, if availabletrustType- The minimumTrustTyperequired- Returns:
- true if player can use item, false if not
-
canUseItem
boolean canUseItem(Object source, Object itemStack, Object location, @Nullable User user, TrustType trustType, boolean leftClick, boolean shift) Checks if this player can use item at a specified location.
Note: If source was performed directly by player, pass player
Note: If source or item is custom, pass a string identifier in format 'modid:name'
Note: If item is activated on right-click then 'leftClick' should be false.- Parameters:
source- The source performing the use actionitemStack- The target itemStacklocation- The location where item will be useduser- The user associated with action, if availabletrustType- The minimumTrustTyperequiredleftClick- If item will be activated on left-clickshift- If item activation requires shift.- Returns:
- true if player can use item, false if not
-
getActiveFlagPermissionValue
- Parameters:
flag- The flagsubject- The subjectcontexts- The contexts- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, TrustType type) - Parameters:
flag- The flagsubject- The subjectcontexts- The contextstype- The trust type- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, boolean checkOverride) - Parameters:
flag- The flagsubject- The subjectcontexts- The contextscheckOverride- Whether to check override- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Set<Context> contexts, TrustType type, boolean checkOverride) - Parameters:
flag- The flagsubject- The subjectcontexts- The contextstype- The trust typecheckOverride- Whether to check override- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts) - Parameters:
flag- The flagsubject- The subjectsource- The sourcetarget- The targetcontexts- The contexts- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, boolean checkOverride) - Parameters:
flag- The flagsubject- The subjectsource- The sourcetarget- The targetcontexts- The contextscheckOverride- Whether to check override- Returns:
- The active flag value
-
getActiveFlagPermissionValue
default Tristate getActiveFlagPermissionValue(Flag flag, Subject subject, Object source, Object target, Set<Context> contexts, TrustType type, boolean checkOverride) - Parameters:
flag- The flagsubject- The subjectsource- The sourcetarget- The targetcontexts- The contextstype- The trust typecheckOverride- Whether to check override- Returns:
- The active flag value
-
getFlagPermissionValue
Gets theFlagpermission value withContext's. Note: This uses the default subject which applies to all users in claim.- Parameters:
flag- The claim flagcontexts- The claim contextstarget- The target id- Returns:
- The permission value, or
Tristate.UNDEFINEDif none
-
setFlagPermission
default CompletableFuture<PermissionResult> setFlagPermission(Flag flag, Tristate value, Set<Context> contexts) SetsFlagpermission withContext's. Note: This uses the default subject which applies to all users in claim.- Parameters:
flag- The claim flagvalue- The new valuecontexts- The claim contexts- Returns:
- The permission result future
-
setFlagPermission
default CompletableFuture<PermissionResult> setFlagPermission(Flag flag, Subject subject, Tristate value, Set<Context> contexts) - Parameters:
flag- The claim flagsubject- The subjectvalue- The new valuecontexts- The claim contexts- Returns:
- The permission result future
-
setFlagDefinition
default CompletableFuture<PermissionResult> setFlagDefinition(FlagDefinition definition, Tristate value) SetFlagDefinitionin thisClaim.- Parameters:
definition- The flag definitionvalue- The new value- Returns:
- The permission result future
-
setFlagDefinition
CompletableFuture<PermissionResult> setFlagDefinition(Subject subject, FlagDefinition definition, Tristate value) - Parameters:
subject- The subjectdefinition- The flag definitionvalue- The new value- Returns:
- The permission result future
-
setOptionDefinition
default CompletableFuture<PermissionResult> setOptionDefinition(OptionDefinition definition, String value) SetOptionDefinitionin thisClaim.- Parameters:
definition- The option definitionvalue- The new value- Returns:
- The permission result future
-
setOptionDefinition
CompletableFuture<PermissionResult> setOptionDefinition(Subject subject, OptionDefinition definition, String value) - Parameters:
subject- The subjectdefinition- The option definitionvalue- The new value- Returns:
- The permission result future
-
getActiveOptionValue
default <T> T getActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Set<Context> contexts) - Parameters:
type- The option typeoption- The optioncontexts- The contextsclaim- The claim- Returns:
- The active option value
-
getActiveOptionValue
default <T> T getActiveOptionValue(io.leangen.geantyref.TypeToken<T> type, Option<T> option, Subject subject, Set<Context> contexts) - Parameters:
type- The option typeoption- The optionsubject- The subjectcontexts- The contextsclaim- The claim- Returns:
- The active option value
-
getOptionValue
- Parameters:
option- The optioncontexts- The contextsclaim- The claim- Returns:
- The option value
-
getOptionValue
- Parameters:
option- The optionsubject- The subjectcontexts- The contextsclaim- The claim- Returns:
- The option value
-
getActiveOptionDefinitionValue
Gets the activeOptionDefinitionvalue in thisClaim.- Parameters:
definition- The option definition- Returns:
- The active value
-
getActiveOptionDefinitionValue
Gets the activeOptionDefinitionvalue in thisClaim.- Parameters:
definition- The option definition- Returns:
- The active value
-
setOption
default CompletableFuture<PermissionResult> setOption(Option option, String value, Set<Context> contexts) SetsOptionvalue withContext's. Note: This uses the default subject which applies to all users in claim.- Parameters:
option- The optionvalue- The new valuecontexts- The claim contexts- Returns:
- The permission result future
-
setOption
default CompletableFuture<PermissionResult> setOption(Option option, Subject subject, String value, Set<Context> contexts) - Parameters:
option- The optionsubject- The subjectvalue- The new valuecontexts- The claim contexts- Returns:
- The permission result future
-
getDefaultTypeContext
Context getDefaultTypeContext()Gets the default context which is used for storing flag defaults.- Returns:
- The default context
-
getOverrideTypeContext
Context getOverrideTypeContext()Gets the override context which is used for overriding claim flags.- Returns:
- The override context
-
builder
Gets a new claim builder instance forClaim.Builder.- Returns:
- A new claim builder instance
-