DUXPLIMA Documentation

Domain model

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

The model lives in com.uxplima.claim.domain.model, with the enums in .enums and the coordinate types in .vo. Read it freely; change it only through the facade.

Claim

The aggregate root. Every other object on this page belongs to one claim.

GetterType
getId()UUID
getName()String
getCreationDate() / getExpireDate()Instant
getSpawnLocation()domain Location
getBlock()ClaimBlock
getVault()ClaimVault
getChunks() / getMembers() / getRoles() / getWarps() / getBans() / getInvites()Read-only Map<UUID, …>
getFlags()Read-only Set<ClaimFlag>

The maps are keyed by each entry's own id, not by a player's UUID. To find a player, use the …ByUid lookups below.

MethodReturns
hasPermission(UUID, ClaimPermission)Whether that player may do it here. The one that matters
isOwner(UUID)Whether that player owns it
getOwnerUid() / getOwner() / findOwner()The owner's UUID, as ClaimMember, or as Optional
getMainChunk() / findMainChunk()The chunk holding the block, hologram and spawn
getRemainTime() / isExpired()A Duration until expiry, negative once expired
hasFlag(ClaimFlag)Whether the flag is set
has… / find… / get… + MemberByUid, BanByUid, InviteByUidA player's membership, ban or invite
has… / find… / get… + RoleById, RoleByType, RoleByPriorityA role
has… / find… / get… + WarpById, WarpByNameA warp
has… / find… / get… + ChunkById, ChunkByData(Chunk), ChunkByLocation(Location)A chunk
has… / find… / get… + MemberById, BanById, InviteByIdAn entry by its own id

has… returns boolean, find… an Optional, and get… the object or a ClaimException.

hasPermission

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

One call resolves the whole chain, in this order:

StepResult
The player is bannedDenied
The player is the ownerAllowed
The member has a per-member denyDenied
The member has a per-member allowAllowed
The member's role, or the MEMBER role if theirs was deletedThat role's answer
Not a memberThe DEFAULT role's answer

A missing role denies rather than throws, and a null argument returns false. Do not reimplement the chain.

It does not consider uxmclaims.admin. ClaimPermissionPolicy does: it treats operators and holders of uxmclaims.admin as allowed, then falls through to the claim.

ClaimPermissionPolicy policy = api.getInstance(ClaimPermissionPolicy.class);

policy.hasPerm(uuid, claim, ClaimPermission.BLOCK_BREAK);
policy.isOwner(uuid, claim);
policy.canPerform(uuid, ClaimAction.CLAIM_DELETE);

canPerform checks an ability node, with bypass and wildcard nodes first.

The pieces

TypeGetters
ClaimMembergetId, getUid, getClaimId, getRoleId, getJoinDate, getAllowedPermissions, getDeniedPermissions, hasAllowedPermission, hasDeniedPermission
ClaimRolegetId, getClaimId, getName, getPriority, getType, getPermissions, hasPermission, isOwner, isMember, isDefault, isCustom
ClaimChunkgetId, getClaimId, getChunk, getCreatedAt, isMain
ClaimWarpgetId, getClaimId, getName, getLocation, isPublic, getCreatedBy, getCreatedAt
ClaimBangetId, getClaimId, getActorUid, getBannedUid, getReason, getBannedAt
ClaimInvitegetId, getClaimId, getActorUid, getInvitedUid, getInvitedAt
ClaimBlockgetId, getClaimId, getKeyId, getLocation, isPlaced
ClaimVaultgetId, getClaimId, getActorUid, getUpdatedAt, getItems (List<ClaimVaultItem>)
ClaimVaultItemgetVaultId, getSlot, getItemStack (the stack, serialised to a String)
CPlayergetUid, getName, getTexture, getSignature, getFirstLoginDate, getLastLoginDate
vo.LocationgetWorld (name), getX, getY, getZ, getChunk, getBlockLocation
vo.ChunkgetWorld (name), getX, getZ, getCenter, isNeighbor

A member's denied set is checked before the allowed set, so a denial always wins. Convert Location and Chunk to Bukkit with BukkitConverter.

The enums

EnumValuesPage
ClaimFlag32Flags
ClaimPermission48Role permissions
ClaimAction30Ability permissions
ClaimRoleTypeOWNER, MEMBER, DEFAULT, CUSTOMRoles

ClaimAction builds its own permission strings (toPermissionNode(…), toBypassNode(…), toCategoryWildcard(), toBypassCategoryWildcard()), which keeps the ability and bypass node families in sync. ClaimSideEffect is not a domain enum: it lives in com.uxplima.claim.app.command.options, see The API.

Model objects are copies

Every Claim the facade returns is a copy of the plugin's cached state at the moment you fetched it. Mutating methods such as rename or addFlag change only your copy: nothing is saved, no event fires, and the plugin never sees it. Make changes through the facade, and fetch again after a write instead of reusing an old copy.

Related: The API, Events