Interface IClaimsManagerAPI
- All Known Subinterfaces:
IClientClaimsManagerAPI,IServerClaimsManagerAPI
Special claim owners can be found at SpecialClaimOwners, such as for server claims.
-
Method Summary
Modifier and TypeMethodDescriptionget(net.minecraft.resources.ResourceLocation dimension, int x, int z) Gets the claim state for a specified chunk.get(net.minecraft.resources.ResourceLocation dimension, net.minecraft.core.BlockPos blockPos) Gets the claim state for a specified chunk.get(net.minecraft.resources.ResourceLocation dimension, net.minecraft.world.level.ChunkPos chunkPos) Gets the claim state for a specified chunk.intgetColor(IPlayerChunkClaimAPI claimState, net.minecraft.resources.ResourceLocation dimension) Gets the color that would be used for a provided claim state and dimension.getCustomName(IPlayerChunkClaimAPI claimState, net.minecraft.resources.ResourceLocation dimension) Gets the custom display name that would be used for a provided claim state and dimension.net.minecraft.network.chat.ComponentgetDefaultName(UUID claimId, boolean forceloadable) Gets the default display name that would be used for a provided claim UUID.net.minecraft.network.chat.ComponentgetDefaultName(UUID claimId, boolean forceloadable, boolean allowPartyNames) Gets the default display name that would be used for a provided claim UUID.net.minecraft.network.chat.ComponentgetDefaultName(IPlayerChunkClaimAPI claimState) Gets the default display name that would be used for a provided claim state.net.minecraft.network.chat.ComponentgetDefaultName(IPlayerChunkClaimAPI claimState, boolean allowPartyNames) Gets the default display name that would be used for a provided claim state.getDimension(net.minecraft.resources.ResourceLocation dimension) Gets the read-only claims manager for a specified dimension ID.net.minecraft.network.chat.ComponentgetFullName(IPlayerChunkClaimAPI claimState) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state.net.minecraft.network.chat.ComponentgetFullName(IPlayerChunkClaimAPI claimState, boolean allowPartyNames) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state.net.minecraft.network.chat.ComponentgetFullName(IPlayerChunkClaimAPI claimState, net.minecraft.resources.ResourceLocation dimension, boolean allowPartyNames) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state and dimension.getPlayerInfo(UUID playerId) Gets or creates the claim info instance for a player UUID.Gets the claim change tracker that lets you register claim change listeners.booleanhasPlayerInfo(UUID playerId) Checks whether a player has claim info.booleanChecks whether anchor-based claiming is used.
-
Method Details
-
hasPlayerInfo
Checks whether a player has claim info.- Parameters:
playerId- UUID of the player, not null- Returns:
- true if the player with UUID
playerIdhas claims info, otherwise false
-
getPlayerInfo
Gets or creates the claim info instance for a player UUID.- Parameters:
playerId- UUID of a player, not null- Returns:
- the player claim info, not null
-
get
@Nullable IPlayerChunkClaimAPI get(@Nonnull net.minecraft.resources.ResourceLocation dimension, int x, int z) Gets the claim state for a specified chunk.- Parameters:
dimension- the dimension ID of the chunk, not nullx- the X coordinate of the chunkz- the Z coordinate of the chunk- Returns:
- the current claim state at the specified location, null if wilderness
-
get
@Nullable IPlayerChunkClaimAPI get(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull net.minecraft.world.level.ChunkPos chunkPos) Gets the claim state for a specified chunk.- Parameters:
dimension- the dimension ID of the chunk, not nullchunkPos- the coordinates of the chunk, not null- Returns:
- the current claim state at the specified location, null if wilderness
-
get
@Nullable IPlayerChunkClaimAPI get(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull net.minecraft.core.BlockPos blockPos) Gets the claim state for a specified chunk.- Parameters:
dimension- the dimension ID of the chunk, not nullblockPos- the block coordinates of the chunk, not null- Returns:
- the current claim state at the specified location, null if wilderness
-
getDimension
@Nullable IDimensionClaimsManagerAPI getDimension(@Nonnull net.minecraft.resources.ResourceLocation dimension) Gets the read-only claims manager for a specified dimension ID.- Parameters:
dimension- the dimension ID, not null- Returns:
- the dimension claims manager, null if no claim data exists for the specified dimension
-
getTracker
Gets the claim change tracker that lets you register claim change listeners.The tracker notifies the registered listeners when claim changes occur.
- Returns:
- the claim change tracker
-
getDefaultName
@Nonnull net.minecraft.network.chat.Component getDefaultName(@Nullable IPlayerChunkClaimAPI claimState) Gets the default display name that would be used for a provided claim state.Calling this method is the equivalent of calling
getDefaultName(IPlayerChunkClaimAPI, boolean)with allowPartyNames as true.- Parameters:
claimState- the claim state, can be null for wilderness- Returns:
- the default display name, not null
-
getDefaultName
@Nonnull net.minecraft.network.chat.Component getDefaultName(@Nullable IPlayerChunkClaimAPI claimState, boolean allowPartyNames) Gets the default display name that would be used for a provided claim state.With this method you can specify whether you want party names applied to party-owned claims or to always use player names.
- Parameters:
claimState- the claim state, can be null for wildernessallowPartyNames- whether to apply party names to party-owned claims- Returns:
- the default display name, not null
-
getDefaultName
@Nonnull net.minecraft.network.chat.Component getDefaultName(@Nullable UUID claimId, boolean forceloadable) Gets the default display name that would be used for a provided claim UUID.Calling this method is the equivalent of calling
getDefaultName(UUID, boolean, boolean)with allowPartyNames as true.- Parameters:
claimId- the UUID of the claimer owner, null for wildernessforceloadable- whether to get the default name for a forceloaded claim- Returns:
- the default display name, not null
-
getDefaultName
@Nonnull net.minecraft.network.chat.Component getDefaultName(@Nullable UUID claimId, boolean forceloadable, boolean allowPartyNames) Gets the default display name that would be used for a provided claim UUID.With this method you can specify whether you want party names applied to party-owned claims or to always use player names.
- Parameters:
claimId- the UUID of the claimer owner, null for wildernessforceloadable- whether to get the default name for a forceloaded claimallowPartyNames- whether to apply party names to party-owned claims- Returns:
- the default display name, not null
-
getFullName
@Nonnull net.minecraft.network.chat.Component getFullName(@Nullable IPlayerChunkClaimAPI claimState) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state.Calling this method is the equivalent of calling
getFullName(IPlayerChunkClaimAPI, boolean)with allowPartyNames as true.- Parameters:
claimState- the claim state, can be null for wilderness- Returns:
- the full display name, not null
-
getFullName
@Nonnull net.minecraft.network.chat.Component getFullName(@Nullable IPlayerChunkClaimAPI claimState, boolean allowPartyNames) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state.With this method you can specify whether you want party names applied to party-owned claims or to always use player names.
This method does not apply dimension-specific names to wilderness or expired claims. Use
getFullName(IPlayerChunkClaimAPI, ResourceLocation, boolean)instead for that.- Parameters:
claimState- the claim state, can be null for wildernessallowPartyNames- whether to apply party names to party-owned claims- Returns:
- the full display name, not null
-
getFullName
@Nonnull net.minecraft.network.chat.Component getFullName(@Nullable IPlayerChunkClaimAPI claimState, @Nullable net.minecraft.resources.ResourceLocation dimension, boolean allowPartyNames) Gets the full display name, with sub-claim names applied, that would be used for a provided claim state and dimension.The dimension argument only matters when claimState is null (wilderness) or an expired claim.
With this method you can specify whether you want party names applied to party-owned claims or to always use player names.
- Parameters:
claimState- the claim state, can be null for wildernessdimension- the dimension the claim is in, null when doesn't matterallowPartyNames- whether to apply party names to party-owned claims- Returns:
- the full display name, not null
-
getCustomName
@Nullable String getCustomName(@Nullable IPlayerChunkClaimAPI claimState, @Nullable net.minecraft.resources.ResourceLocation dimension) Gets the custom display name that would be used for a provided claim state and dimension.The dimension argument only matters when claimState is null (wilderness) or an expired claim.
The returned value on the client side is null before the custom name is synced from the server. The returned name may also not correspond to the dimension before the dimension-specific name is synced.
- Parameters:
claimState- the claim state, can be null for wildernessdimension- the dimension the claim is in, null when doesn't matter- Returns:
- the custom name of the claims, null if there is none
-
getColor
int getColor(@Nullable IPlayerChunkClaimAPI claimState, @Nullable net.minecraft.resources.ResourceLocation dimension) Gets the color that would be used for a provided claim state and dimension.The dimension argument only matters when claimState is null (wilderness) or an expired claim.
The returned value on the client side is the default color (0 for actual players) before the color is synced from the server. The returned color may also not correspond to the dimension before the dimension-specific color is synced.
- Parameters:
claimState- the claim state, can be null for wildernessdimension- the dimension the claim is in, null when doesn't matter- Returns:
- the color of the claim state
-
usingAnchorBasedClaiming
boolean usingAnchorBasedClaiming()Checks whether anchor-based claiming is used.The returned value is false on the client side before the real one is synced from the server.
- Returns:
- true if anchor-based claiming is enabled on the server, otherwise false
-