Interface IServerClaimsManagerAPI
- All Superinterfaces:
IClaimsManagerAPI
-
Method Summary
Modifier and TypeMethodDescriptionclaim
(net.minecraft.resources.ResourceLocation dimension, UUID id, int subConfigIndex, int x, int z, boolean forceload) Directly replaces the current claim state of a chunk.get
(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.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
getPlayerBaseClaimLimit
(UUID playerId) Gets the base maximum claim number (without the bonus) for a player UUID.int
getPlayerBaseClaimLimit
(net.minecraft.server.level.ServerPlayer player) Gets the base maximum claim number (without the bonus) for a logged in player.int
getPlayerBaseForceloadLimit
(UUID playerId) Gets the base maximum forceload number (without the bonus) for a player UUID.int
getPlayerBaseForceloadLimit
(net.minecraft.server.level.ServerPlayer player) Gets the base maximum forceload number (without the bonus) for a logged in player.getPlayerInfo
(UUID playerId) Gets or creates the claim info instance for a player UUID.Gets a stream of all player claim info.Gets the claim change tracker that lets you register claim change listeners.boolean
hasPlayerInfo
(UUID playerId) Checks whether a player has claim info.boolean
isClaimable
(net.minecraft.resources.ResourceLocation dimension) Checks whether a dimension is claimable.tryToClaim
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int subConfigIndex, int fromX, int fromZ, int x, int z, boolean replace) Tries to claim a chunk by a specified player.tryToClaimArea
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int subConfigIndex, int fromX, int fromZ, int left, int top, int right, int bottom, boolean replace) Tries to claim chunks over a specified area by a specified player.tryToForceload
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int fromX, int fromZ, int x, int z, boolean enable, boolean replace) Tries to (un)mark a chunk for forceloading by a specified player.tryToForceloadArea
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int fromX, int fromZ, int left, int top, int right, int bottom, boolean enable, boolean replace) Tries to (un)mark chunks for forceloading over a specified area by a specified player.tryToUnclaim
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int fromX, int fromZ, int x, int z, boolean replace) Tries to unclaim a chunk by a specified player.tryToUnclaimArea
(net.minecraft.resources.ResourceLocation dimension, UUID playerId, int fromX, int fromZ, int left, int top, int right, int bottom, boolean replace) Tries to unclaim chunks over a specified area by a specified player.void
unclaim
(net.minecraft.resources.ResourceLocation dimension, int x, int z) Directly removes the current claim state of a chunk.
-
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 IServerDimensionClaimsManagerAPI 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
-
isClaimable
boolean isClaimable(@Nonnull net.minecraft.resources.ResourceLocation dimension) Checks whether a dimension is claimable.Claimable dimensions are determined by the server config.
- Parameters:
dimension
- the dimension ID- Returns:
- whether the dimension is claimable
-
claim
@Nullable IPlayerChunkClaimAPI claim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID id, int subConfigIndex, int x, int z, boolean forceload) Directly replaces the current claim state of a chunk.It is usually a bad idea to give regular players unfiltered access to this method. Use
tryToClaim(net.minecraft.resources.ResourceLocation, java.util.UUID, int, int, int, int, int, boolean)
ortryToForceload(net.minecraft.resources.ResourceLocation, java.util.UUID, int, int, int, int, boolean, boolean)
instead if you want different limitations to be considered, e.g. maximum claim distance, maximum claim number, the chunk being already claimed etc.- Parameters:
dimension
- the dimension ID of the chunk, not nullid
- the claim owner UUID, not nullsubConfigIndex
- the sub-config index to be used by the claimx
- the X coordinate of the chunkz
- the Z coordinate of the chunkforceload
- whether the chunk should be marked for forceloading- Returns:
- the new claim state, null if claims are disabled
-
unclaim
void unclaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, int x, int z) Directly removes the current claim state of a chunk.It is usually a bad idea to give regular players unfiltered access to this method. Use
tryToUnclaim(net.minecraft.resources.ResourceLocation, java.util.UUID, int, int, int, int, boolean)
instead if you want different limitations to be considered, e.g. maximum claim distance, the chunk being claimed by a different player etc.- Parameters:
dimension
- the dimension ID of the chunk, not nullx
- the X coordinate of the chunkz
- the Z coordinate of the chunk
-
tryToClaim
@Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToClaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int subConfigIndex, int fromX, int fromZ, int x, int z, boolean replace) Tries to claim a chunk by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum claim number, maximum claim distance, existing claims.
You get a
ClaimResult
containing a claim state where relevant (the new one if it's a success) and a message describing the result.- Parameters:
dimension
- the dimension ID of the chunk, not nullplayerId
- the claiming player UUID, not nullsubConfigIndex
- the sub-config index to be used by the claimfromX
- the X coordinate of the claiming player's current chunk positionfromZ
- the Z coordinate of the claiming player's current chunk positionx
- the X coordinate of the chunk to claimz
- the Z coordinate of the chunk to claimreplace
- whether to ignore some limitations, mainly the existing claim state at the specified location and the maximum claim distance- Returns:
- the result, not null
-
tryToUnclaim
@Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToUnclaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int x, int z, boolean replace) Tries to unclaim a chunk by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum claim distance, existing claims.
You get a
ClaimResult
containing a claim state where relevant (null if it's a success) and a message describing the result.- Parameters:
dimension
- the dimension ID of the chunk, not nullplayerId
- the unclaiming player UUID, not nullfromX
- the X coordinate of the unclaiming player's current chunk positionfromZ
- the Z coordinate of the unclaiming player's current chunk positionx
- the X coordinate of the chunk to unclaimz
- the Z coordinate of the chunk to unclaimreplace
- whether to ignore some limitations, mainly the existing claim owner at the specified location and the maximum claim distance- Returns:
- the result, not null
-
tryToForceload
@Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToForceload(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int x, int z, boolean enable, boolean replace) Tries to (un)mark a chunk for forceloading by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum forceload number, maximum claim distance, existing claims.
You get a
ClaimResult
containing a claim state where relevant (the new one if it's a success) and a message describing the result.- Parameters:
dimension
- the dimension ID of the chunk, not nullplayerId
- the claiming player UUID, not nullfromX
- the X coordinate of the claiming player's current chunk positionfromZ
- the Z coordinate of the claiming player's current chunk positionx
- the X coordinate of the chunk to (un)mark for forceloadingz
- the Z coordinate of the chunk to (un)mark for forceloadingenable
- true to mark for forceloading, false to unmarkreplace
- whether to ignore some limitations, mainly the existing claim owner at the specified location and the maximum claim distance- Returns:
- the result, not null
-
tryToClaimArea
@Nonnull AreaClaimResult tryToClaimArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int subConfigIndex, int fromX, int fromZ, int left, int top, int right, int bottom, boolean replace) Tries to claim chunks over a specified area by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum claim number, maximum claim distance, existing claims.
You get a
AreaClaimResult
containing all unique result types, which contain messages describing the results.- Parameters:
dimension
- the dimension ID of the chunks, not nullplayerId
- the claiming player UUID, not nullsubConfigIndex
- the sub-config index to be used by the claimsfromX
- the X coordinate of the claiming player's current chunk positionfromZ
- the Z coordinate of the claiming player's current chunk positionleft
- 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 areareplace
- whether to ignore some limitations, mainly the existing claim owner at the specified location and the maximum claim distance- Returns:
- the area result, not null
-
tryToUnclaimArea
@Nonnull AreaClaimResult tryToUnclaimArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int left, int top, int right, int bottom, boolean replace) Tries to unclaim chunks over a specified area by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum claim distance, existing claims.
You get a
AreaClaimResult
containing all unique result types, which contain messages describing the results.- Parameters:
dimension
- the dimension ID of the chunks, not nullplayerId
- the claiming player UUID, not nullfromX
- the X coordinate of the unclaiming player's current chunk positionfromZ
- the Z coordinate of the unclaiming player's current chunk positionleft
- 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 areareplace
- whether to ignore some limitations, mainly the existing claim owner at the specified location and the maximum claim distance- Returns:
- the area result, not null
-
tryToForceloadArea
@Nonnull AreaClaimResult tryToForceloadArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int left, int top, int right, int bottom, boolean enable, boolean replace) Tries to (un)mark chunks for forceloading over a specified area by a specified player.Success is not guaranteed. Different limitations are checked, e.g. maximum forceload number, maximum claim distance, existing claims.
You get a
AreaClaimResult
containing all unique result types, which contain messages describing the results.- Parameters:
dimension
- the dimension ID of the chunks, not nullplayerId
- the claiming player UUID, not nullfromX
- the X coordinate of the unclaiming player's current chunk positionfromZ
- the Z coordinate of the unclaiming player's current chunk positionleft
- 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 mark for forceloading, false to unmarkreplace
- whether to ignore some limitations, mainly the existing claim owner at the specified location and the maximum claim distance- Returns:
- the area result, not null
-
getPlayerBaseClaimLimit
Gets the base maximum claim number (without the bonus) for a player UUID.By default, the base claim limit is configured in this mod's server config file. However, if the FTB Ranks mod is installed, a permission node is configured in the claim mod's server config and the player with UUID
playerId
is logged in, then the permission value is used as the base limit.- Parameters:
playerId
- the player UUID, not null- Returns:
- the base maximum claim number
-
getPlayerBaseClaimLimit
int getPlayerBaseClaimLimit(@Nonnull net.minecraft.server.level.ServerPlayer player) Gets the base maximum claim number (without the bonus) for a logged in player.By default, the base claim limit is configured in this mod's server config file. However, if the FTB Ranks mod is installed and a permission node is configured in the claim mod's server config, then the permission value is used as the base limit.
- Parameters:
player
- the player, not null- Returns:
- the base maximum claim number
-
getPlayerBaseForceloadLimit
Gets the base maximum forceload number (without the bonus) for a player UUID.By default, the base forceload limit is configured in this mod's server config file. However, if the FTB Ranks mod is installed, a permission node is configured in the claim mod's server config and the player with UUID
playerId
is logged in, then the permission value is used as the base limit.- Parameters:
playerId
- the player UUID, not null- Returns:
- the base maximum forceload number
-
getPlayerBaseForceloadLimit
int getPlayerBaseForceloadLimit(@Nonnull net.minecraft.server.level.ServerPlayer player) Gets the base maximum forceload number (without the bonus) for a logged in player.By default, the base forceload limit is configured in this mod's server config file. However, if the FTB Ranks mod is installed and a permission node is configured in the claim mod's server config, then the permission value is used as the base limit.
- Parameters:
player
- the player, not null- Returns:
- the base maximum forceload number
-