Interface IClientClaimsManagerAPI
- All Superinterfaces:
IClaimsManagerAPI
-
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.int
Gets the local client player's chunk claim limit.Gets the claim action result tracker that lets you register claim action result listeners.Gets the string ID of the sub-config currently used for new server claims.int
Gets the index of the sub-config currently used for new server claims.Gets the string ID of the sub-config currently used for new claims.int
Gets the index of the sub-config currently used for new claims.getDimension
(net.minecraft.resources.ResourceLocation dimension) Gets the read-only claims manager for a specified dimension ID.Gets a stream of all read-only dimension claims managers.int
Gets the local client player's chunk claim forceload limit.int
Gets the maximum distance for claiming/forceloading a chunk allowed by the server.getPlayerInfo
(UUID playerId) Gets or creates the claim info instance for a player UUID.Gets a stream of all player claim info.Gets a claim state of the same type (seeIPlayerChunkClaimAPI.isSameClaimType(IPlayerChunkClaimAPI)
) as would be placed in the world when the player requests a new claim.Gets the claim change tracker that lets you register claim change listeners.boolean
hasPlayerInfo
(UUID playerId) Checks whether a player has claim info.boolean
Checks whether the local client player is in admin mode.boolean
Checks whether the initial server chunk claim sync is in progress.boolean
Checks whether the local client player is in server claim mode.void
requestAreaClaim
(int left, int top, int right, int bottom, boolean byServer) Requests new chunks claims over a specified area by the local client player or by the server.void
requestAreaForceload
(int left, int top, int right, int bottom, boolean enable, boolean byServer) Requests chunk (un)forceloads over a specified area by the local client player or by the server.void
requestAreaUnclaim
(int left, int top, int right, int bottom, boolean byServer) Requests chunk unclaims over a specified area by the local client player or by the server.void
requestClaim
(int x, int z, boolean byServer) Requests a new chunk claim by the local client player or by the server.void
requestForceload
(int x, int z, boolean enable, boolean byServer) Requests a chunk (un)forceload by the local client player or by the server.void
requestUnclaim
(int x, int z, boolean byServer) Requests a chunk unclaim by the local client player or by the server.
-
Method Details
-
hasPlayerInfo
Description copied from interface:IClaimsManagerAPI
Checks whether a player has claim info.- Specified by:
hasPlayerInfo
in interfaceIClaimsManagerAPI
- Parameters:
playerId
- UUID of the player, not null- Returns:
- true if the player with UUID
playerId
has claims info, otherwise false
-
getPlayerInfo
Description copied from interface:IClaimsManagerAPI
Gets or creates the claim info instance for a player UUID.- Specified by:
getPlayerInfo
in interfaceIClaimsManagerAPI
- Parameters:
playerId
- UUID of a player, not null- Returns:
- the player claim info, not null
-
getPlayerInfoStream
Gets a stream of all player claim info.- Returns:
- a
Stream
of all player claim info
-
get
@Nullable IPlayerChunkClaimAPI get(@Nonnull net.minecraft.resources.ResourceLocation dimension, int x, int z) Description copied from interface:IClaimsManagerAPI
Gets the claim state for a specified chunk.- Specified by:
get
in interfaceIClaimsManagerAPI
- 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) Description copied from interface:IClaimsManagerAPI
Gets the claim state for a specified chunk.- Specified by:
get
in interfaceIClaimsManagerAPI
- 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) Description copied from interface:IClaimsManagerAPI
Gets the claim state for a specified chunk.- Specified by:
get
in interfaceIClaimsManagerAPI
- 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 IClientDimensionClaimsManagerAPI getDimension(@Nonnull net.minecraft.resources.ResourceLocation dimension) Description copied from interface:IClaimsManagerAPI
Gets the read-only claims manager for a specified dimension ID.- Specified by:
getDimension
in interfaceIClaimsManagerAPI
- Parameters:
dimension
- the dimension ID, not null- Returns:
- the dimension claims manager, null if no claim data exists for the specified dimension
-
getDimensionStream
Gets a stream of all read-only dimension claims managers.- Returns:
- a
Stream
of all read-only dimension claims managers
-
getTracker
Description copied from interface:IClaimsManagerAPI
Gets the claim change tracker that lets you register claim change listeners.The tracker notifies the registered listeners when claim changes occur.
- Specified by:
getTracker
in interfaceIClaimsManagerAPI
- Returns:
- the claim change tracker
-
isLoading
boolean isLoading()Checks whether the initial server chunk claim sync is in progress.Chunk claims start loading in the background when you join the server.
- Returns:
- true if the initial chunk claim sync is in progress, otherwise false
-
getClaimLimit
int getClaimLimit()Gets the local client player's chunk claim limit.- Returns:
- the claim limit
-
getForceloadLimit
int getForceloadLimit()Gets the local client player's chunk claim forceload limit.- Returns:
- the forceload limit
-
getMaxClaimDistance
int getMaxClaimDistance()Gets the maximum distance for claiming/forceloading a chunk allowed by the server.- Returns:
- the maximum claim distance
-
isAdminMode
boolean isAdminMode()Checks whether the local client player is in admin mode.- Returns:
- true if the player is in admin mode, otherwise false
-
isServerMode
boolean isServerMode()Checks whether the local client player is in server claim mode.- Returns:
- true if the player is in server claim mode, otherwise false
-
getClaimResultTracker
Gets the claim action result tracker that lets you register claim action result listeners.The tracker notifies the registered listeners when the client receives a claim result from the server. This happens after the player requests a claim action, e.g. to (un)claim some chunks.
- Returns:
- the claim action result tracker, not null
-
requestClaim
void requestClaim(int x, int z, boolean byServer) Requests a new chunk claim by the local client player or by the server.Only OPs can request claims by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
x
- the X coordinate of the chunkz
- the Z coordinate of the chunkbyServer
- whether the claim should be made by the server
-
requestUnclaim
void requestUnclaim(int x, int z, boolean byServer) Requests a chunk unclaim by the local client player or by the server.Only OPs can request unclaims by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
x
- the X coordinate of the chunkz
- the Z coordinate of the chunkbyServer
- whether the unclaim should be made by the server
-
requestForceload
void requestForceload(int x, int z, boolean enable, boolean byServer) Requests a chunk (un)forceload by the local client player or by the server.Only OPs can request (un)forceloads by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
x
- the X coordinate of the chunkz
- the Z coordinate of the chunkenable
- true to forceload the chunk, false to unforceloadbyServer
- whether the (un)forceload should be made by the server
-
requestAreaClaim
void requestAreaClaim(int left, int top, int right, int bottom, boolean byServer) Requests new chunks claims over a specified area by the local client player or by the server.Only OPs can request claims by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
left
- the lowest X coordinate of the areatop
- the lowest Z coordinate of the arearight
- the highest X coordinate of the areabottom
- the highest Z coordinate of the areabyServer
- whether the claim should be made by the server
-
requestAreaUnclaim
void requestAreaUnclaim(int left, int top, int right, int bottom, boolean byServer) Requests chunk unclaims over a specified area by the local client player or by the server.Only OPs can request unclaims by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
left
- the lowest X coordinate of the areatop
- the lowest Z coordinate of the arearight
- the highest X coordinate of the areabottom
- the highest Z coordinate of the areabyServer
- whether the unclaim should be made by the server
-
requestAreaForceload
void requestAreaForceload(int left, int top, int right, int bottom, boolean enable, boolean byServer) Requests chunk (un)forceloads over a specified area by the local client player or by the server.Only OPs can request (un)forceloads by the server.
Register a claim result listener with
IClaimsManagerClaimResultTrackerAPI
to receive the result of this request.- Parameters:
left
- the lowest X coordinate of the areatop
- the lowest Z coordinate of the arearight
- the highest X coordinate of the areabottom
- the highest Z coordinate of the areaenable
- true to forceload the chunks, false to unforceloadbyServer
- whether the (un)forceload should be made by the server
-
getPotentialClaimStateReflection
Gets a claim state of the same type (seeIPlayerChunkClaimAPI.isSameClaimType(IPlayerChunkClaimAPI)
) as would be placed in the world when the player requests a new claim.It's not the actual instance of the claim state that would be placed in the world but it's good enough for comparisons against actual existing claim states.
- Returns:
- a claim state reflection of the same type as a new claim, null if unknown
-
getCurrentSubConfigIndex
int getCurrentSubConfigIndex()Gets the index of the sub-config currently used for new claims.- Returns:
- the current sub-config index
-
getCurrentServerSubConfigIndex
int getCurrentServerSubConfigIndex()Gets the index of the sub-config currently used for new server claims.- Returns:
- the current server sub-config index
-
getCurrentSubConfigId
String getCurrentSubConfigId()Gets the string ID of the sub-config currently used for new claims.- Returns:
- the current sub-config ID
-
getCurrentServerSubConfigId
String getCurrentServerSubConfigId()Gets the string ID of the sub-config currently used for new server claims.- Returns:
- the current server sub-config ID
-