DUXPLIMA Documentation

Domain model

Claim and the objects hanging off it, and the one method worth knowing.

Everything lives under com.uxplima.claim.domain.model.

Claim

The aggregate root.

UUID    id
String  name
Instant expireDate
Instant creationDate
Location spawnLocation
ClaimBlock block
ClaimVault vault

Map<UUID, ClaimChunk>  chunks
Map<UUID, ClaimMember> members
Map<UUID, ClaimRole>   roles
Map<UUID, ClaimWarp>   warps
Map<UUID, ClaimBan>    bans
Map<UUID, ClaimInvite> invites

Set<ClaimFlag> flags
MethodReturns
getOwnerUid()The owner's UUID
getOwner()The owner as a ClaimMember
getMainChunk()The chunk holding the block, hologram and spawn
getRemainTime()A Duration until expiry
isOwner(UUID)Whether that player owns it
hasMemberByUid(UUID)Whether they are a member
hasBanByUid(UUID)Whether they are banned
hasFlag(ClaimFlag)Whether the flag is set
hasPermission(UUID, ClaimPermission)The one that matters
getMemberByUid, getRoleById, getRoleByType, getRoleByPriority, getWarpByName, getChunkByLocation, getBanByUid, getInviteByUidLookups

hasPermission

claim.hasPermission(player.getUniqueId(), ClaimPermission.BLOCK_BREAK)

One call, resolving the whole chain: ban, ownership, per-member deny, per-member allow, the member's role, the Member fallback when their role was deleted, and the Default role for non-members. Do not reimplement it: the order is subtle and the fallbacks are easy to get wrong.

It does not consider uxmclaims.admin. For that, go through ClaimPermissionPolicy, which checks the admin node first:

ClaimPermissionPolicy policy = api.getInstance(ClaimPermissionPolicy.class);
policy.hasPerm(uuid, claim, ClaimPermission.BLOCK_BREAK);
policy.isOwner(uuid, claim);
policy.canPerform(uuid, ClaimAction.CLAIM_DELETE);

The pieces

TypeHolds
ClaimMemberuid, roleId, joinDate, allowedPermissions, deniedPermissions
ClaimRolename, priority, type, its permission set
ClaimChunkThe chunk coordinates and world
ClaimWarpname, location, isPublic, createdBy, createdAt
ClaimBanbannedUid, reason, bannedAt
ClaimInviteinvitedUid, invitedAt
ClaimBlockThe style key and where the block sits
ClaimVaultThe stored items

ClaimMember carrying both an allowed and a denied set is the per-member override mechanism. Denied is checked first, so a denial always wins.

The enums

EnumValuesPage
ClaimFlag32Flags
ClaimPermission48Role permissions
ClaimAction30Ability permissions
ClaimRoleTypeOWNER, MEMBER, DEFAULT, CUSTOMn/a
ClaimSideEffectREGION, ECONOMY, WEBHOOK, LIMITATION, PERMISSIONArchitecture

ClaimAction also builds its own permission strings (toPermissionNode(), toBypassNode(), toCategoryWildcard()) which is how the ability and bypass node families stay in sync.

Model objects are snapshots

A Claim you hold is a view of the state when you fetched it. Another server, or another thread, may have changed it since. Re-fetch before acting on stale data, and make changes through the facade rather than by mutating the object: direct mutation is not persisted.