Skip to content

Internal API Reference

INFO

This is the internal API reference for contributors. If you're a plugin developer looking to integrate with LandClaimPlugin, see the Public API page instead.

Managers

ClaimManager

Central business logic for claim operations.

MethodReturnsDescription
initialize()voidLoad all profiles from DB into cache
claimChunk(Player, Chunk)booleanClaim a single chunk for a player
claimChunks(Player, Set)intClaim multiple chunks at once
unclaimChunk(Chunk)booleanUnclaim a single chunk
abandonProfile(UUID)intDelete entire profile, returns chunk count
transferOwnership(UUID, UUID)booleanTransfer profile to new owner
getProfileAt(ChunkPosition)ClaimProfileGet profile owning a chunk
getProfile(UUID)ClaimProfileGet profile by owner UUID
getProfileByName(String)ClaimProfileGet profile by display name
isChunkClaimed(ChunkPosition)booleanCheck if chunk is claimed
getChunkOwner(ChunkPosition)UUIDGet owner UUID of a chunk
isClaimNameUnique(String)booleanCheck if claim name is available
canCreateProfile(UUID)booleanCheck if player can create a new profile
getClaimLimit(Player)intGet effective claim limit (with perms + bonus)
getSelection(UUID)ChunkSelectionGet player's chunk selection
clearSelection(UUID)voidClear player's chunk selection
getTotalClaims()intTotal claimed chunks across all profiles
addAllyInvite(UUID, UUID)voidAdd pending ally invite
removeAllyInvite(UUID, UUID)voidRemove pending ally invite
hasAllyInvite(UUID, UUID)booleanCheck pending ally invite

PermissionResolver

Implements the 4-tier permission chain: Owner › Role › Trusted › Ally › Visitor.

MethodReturnsDescription
hasPermission(ClaimProfile, UUID, String)booleanCheck if player has a flag
getPlayerStatus(ClaimProfile, UUID)StringGet player's status in the claim

BlockPermissionResolver

Maps Minecraft blocks to claim permission flags.

MethodReturnsDescription
resolve(Block)BlockPermissionGet required permission for a block (null = free)

Resolution order: explicit overrides → InventoryHolder check → Tag matching → workstation switch.

CacheManager

Caffeine-backed in-memory caches.

CacheKeyValueExpiry
profileCacheUUID (owner)ClaimProfileNone (max 10,000)
claimCacheUUID (claim id)Claim30 min access (max 10,000)
playerCacheUUID (player)ClaimPlayerNone (max 5,000)

ConfigManager

Configuration lifecycle management using Okaeri Configs.

MethodReturnsDescription
getPluginConfig()PluginConfigMain config instance
getMessagesConfig()MessagesConfigMessages config instance
getMessage(String, String...)StringGet formatted message with placeholders
isWorldBlocked(String)booleanCheck if world is blocked
requireConnectedClaims()booleanConnected claims setting
allowDiagonalConnections()booleanDiagonal connections setting
getWorldGuardGap()intWorldGuard gap setting
getMinClaimGap()intMin claim gap setting
reloadMainConfig()voidReload configuration

CombatManager

Detects combat-tagged players via hooked plugins.

MethodReturnsDescription
isInCombat(Player)booleanCheck if player is in combat

Supported hooks: DeluxeCombat, PvPManager, EternalCombat.

WarpManager

Manages warp teleport points.

MethodReturnsDescription
setWarp(UUID, String, Location, Material)booleanCreate/update a warp
deleteWarp(UUID, String)booleanDelete a warp
getWarp(UUID, String)WarpGet a specific warp
getWarps(UUID)MapGet all warps for a player
getWarpLimit(Player)intGet effective warp limit
getWarpCount(UUID)intGet current warp count
loadFromDatabase()CompletableFutureLoad all warps from DB

VisualizationManager

Renders claim boundaries using display entities or particles.

MethodReturnsDescription
invalidateCache(UUID)voidInvalidate cached visualization
cleanupLocalDisplays()voidRemove all active displays

RedisManager

Cross-server cache invalidation via Redis pub/sub.

MethodReturnsDescription
init()voidConnect and start subscriber
publishUpdate(String, UUID)voidPublish cache invalidation
shutdown()voidClose connections

Message format: ACTION:UUID (e.g., INVALIDATE_PROFILE:uuid)

HookManager

Third-party plugin integrations.

MethodReturnsDescription
init()voidDetect and initialize hooks
isWorldGuardEnabled()booleanWorldGuard available
refreshMapHooks()voidUpdate all map overlays

Supported map plugins: BlueMap, Dynmap, Squaremap, Pl3xMap.

Models

ClaimProfile

Central data model — one per player (or multiple in multi-profile mode).

Key Fields:

  • ownerId — UUID of the owner
  • name — Display name
  • ownedChunks — Set of claimed chunk positions
  • visitorFlags — Base permission layer
  • trustedPlayerFlags — Per-player permission overrides
  • roles — Role definitions
  • memberRoles — Player to role assignments
  • allyFlags — Allied profiles with flags
  • warps — Named warps
  • claimColor — Hex color for visualization
  • visualizationModeDISPLAY_ENTITY or PARTICLE
  • enterTitleEnabled — Entry title toggle
  • enterTitle / leaveTitle — MiniMessage titles

Default Roles:

  • Member (priority 100): Basic interact (doors, containers, workstations, beds, redstone)
  • CoOwner (priority 10): All 25 flags

Role

Permission role with flag-based access control.

FieldTypeDescription
idUUIDUnique role identifier
ownerIdUUIDProfile owner
nameStringDisplay name
priorityintLower = checked first
flagsSetPermission flags (lowercase)

ClaimPlayer

Per-player preferences (persisted in lc_players).

FieldTypeDescription
uniqueIdUUIDPlayer UUID
autoClaimbooleanAuto-claim enabled
autoUnclaimbooleanAuto-unclaim enabled
visualizationModeStringPreferred visualization
bonusClaimBlocksintBonus claim limit

Warp

Named teleport point within a claim.

FieldTypeDescription
nameStringWarp name (case-insensitive)
locationLocationBukkit location
iconMaterialMenu icon material

BlockPermission

Enum mapping block types to permission flags.

Enum ValueFlag
CONTAINERSUSE_CONTAINERS
DOORSUSE_DOORS
TRAPDOORSUSE_TRAPDOORS
FENCE_GATESUSE_FENCE_GATES
REDSTONEUSE_REDSTONE
BEDSUSE_BEDS
WORKSTATIONSUSE_WORKSTATIONS
LECTERNSUSE_LECTERNS
BELLSUSE_BELLS

ChunkPosition

Immutable chunk coordinate with utility methods.

FieldTypeDescription
worldStringWorld name
xintChunk X
zintChunk Z
MethodReturnsDescription
getNeighbors(boolean)ListGet adjacent chunks (optional diagonals)
toChunk(World)ChunkGet Bukkit Chunk object

GUI Framework

CustomGui

Base GUI runtime. Implements InventoryHolder for reliable event routing.

java
// Create a GUI
CustomGui gui = new CustomGui(Component.text("My GUI"), 3); // 3 rows

// Add items with click handlers
gui.setItem(0, itemStack, (player, event) -> {
    // Handle click
});

// Open for player (thread-safe — schedules to main if async)
gui.open(player);

PaginatedGui

Extends CustomGui with page-based navigation. Automatically adds prev/next buttons.

SlotDefinition

Maps structure characters to items + actions for declarative GUI layouts.

java
SlotDefinition filler = new SlotDefinition(fillItem, null);
SlotDefinition button = new SlotDefinition(buttonItem, clickAction);

Map<Character, SlotDefinition> ingredients = Map.of(
    'F', filler,
    'B', button
);

gui.fillFromStructure(new String[]{
    "F F F F F F F F F",
    "F . B . . . B . F",
    "F F F F F F F F F"
}, ingredients);

Command Interface

LandClaimCommand

All commands implement this interface:

java
public interface LandClaimCommand {
    void register(PaperCommandManager<Source> manager, Command.Builder<PlayerSource> claimBuilder);
}

Commands are registered modularly via CommandHandler.

Combat Preprocessor

All commands share a preprocessor that blocks execution during combat:

java
if (combatManager.isInCombat(player)) {
    throw new CombatBlockedException();
}

Released under the MIT License.