DUXPLIMA Documentation

The API

The entry point, the two facades, and every operation they expose.

Entry point

UxmClaimBukkitAPI api = UxmClaimBukkitAPI.getInstance();

ClaimFacade claims   = api.claimFacade();
PlayerFacade players = api.playerFacade();

getInstance() throws IllegalStateException before uxmClaims has initialised. Call it from onEnable with softdepend: [uxmClaims] set.

The API can also resolve anything from the container:

SomeService service = api.getInstance(SomeService.class);
SomeService named   = api.getInstance(SomeService.class, "key");

Reading

Queries are plain methods. Nothing here mutates.

MethodReturns
findById(UUID)Optional<Claim>
findByChunk(Chunk)Optional<Claim>
findByLocation(Location)Optional<Claim>
getById(UUID) / getByChunk / getByLocationClaim, throwing when absent
getByIdUnsafe / getByChunkUnsafe / getByLocationUnsafeClaim or null
existsById / existsByChunk / existsByLocation / existsByWarpNameboolean
findByOwnerUid(UUID)List<Claim>
findByMemberUid(UUID)List<Claim>
findByInvitedUid(UUID)List<Claim>
countByOwnerUid(UUID) / countByMemberUid(UUID)int
findAllClaims()List<Claim>
findExpiredClaims()List<Claim>
findPublicWarps()List<ClaimWarp>

The three families differ in how they handle absence: find… gives you an Optional, get… throws, get…Unsafe returns null. Prefer find… unless you have already checked.

boolean canBuild = claims.findByLocation(loc)
        .map(claim -> claim.hasPermission(player.getUniqueId(), ClaimPermission.BLOCK_PLACE))
        .orElse(true);   // wilderness is not protected

That is the whole of "may this player build here", including bans, ownership, per-member overrides and role fallback, because hasPermission resolves all of it.

Writing

Every write takes a command object and has an overload taking ClaimCommandOptions.

Claim claim = claims.renameClaim(
        ClaimRenameCommand.builder()
                .claimId(id)
                .actorUid(actor)
                .name("New name")
                .build());
AreaMethods
ClaimcreateClaim, deleteClaim, expireClaim, renameClaim, relocateClaim, rescheduleClaim, updateClaimFlags
MembersinviteMember, revokeInvite, acceptInvite, kickMember, leaveMember, banMember, unbanMember, updateMemberPerms, assignMemberRole, transferOwnership
ChunksextendClaim, shrinkClaim
Claim blockplaceBlock, changeBlock, destroyBlock
VaultupdateVault
RolescreateRole, deleteRole, renameRole, updateRolePriority, updateRolePermission
WarpscreateWarp, deleteWarp, renameWarp, relocateWarp, updateWarpVisibility

Each command class mirrors its method name (ClaimRenameCommand, ClaimMemberBanCommand, ClaimWarpCreateCommand) and all of them carry the actorUid the permission check runs against.

Controlling side effects

claims.createClaim(command, ClaimCommandOptions.builder()
        .without(ClaimSideEffect.ECONOMY)
        .without(ClaimSideEffect.WEBHOOK)
        .build());
EffectSkipping it means
ECONOMYNothing is charged
WEBHOOKDiscord is not notified
REGIONWorldGuard overlap is not checked
LIMITATIONEntitlement limits are not enforced
PERMISSIONAbility and role permissions are not enforced

ClaimCommandOptions.all() is the default; none() disables everything, including the two checks you usually want. Prefer removing effects individually.

Threading

Writes touch the database. Call them off the main thread, or accept the tick cost: the facade does not schedule for you. Reads are served from cache and are cheap.

PlayerFacade

api.playerFacade() resolves the plugin's CPlayer records by UUID or name, which is what turns a name typed in chat into something the command objects accept.