Interface IServerClaimsManagerAPI

All Superinterfaces:
IClaimsManagerAPI

public interface IServerClaimsManagerAPI extends IClaimsManagerAPI
API for the claims manager on the server side.

Special claim owners can be found at SpecialClaimOwners, such as for server claims.

  • Method Details

    • hasPlayerInfo

      boolean hasPlayerInfo(@Nonnull UUID playerId)
      Description copied from interface: IClaimsManagerAPI
      Checks whether a player has claim info.
      Specified by:
      hasPlayerInfo in interface IClaimsManagerAPI
      Parameters:
      playerId - UUID of the player, not null
      Returns:
      true if the player with UUID playerId has claims info, otherwise false
    • getPlayerInfo

      @Nonnull IServerPlayerClaimInfoAPI getPlayerInfo(@Nonnull UUID playerId)
      Description copied from interface: IClaimsManagerAPI
      Gets or creates the claim info instance for a player UUID.
      Specified by:
      getPlayerInfo in interface IClaimsManagerAPI
      Parameters:
      playerId - UUID of a player, not null
      Returns:
      the player claim info, not null
    • getPlayerInfoStream

      @Nonnull Stream<IServerPlayerClaimInfoAPI> 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 interface IClaimsManagerAPI
      Parameters:
      dimension - the dimension ID of the chunk, not null
      x - the X coordinate of the chunk
      z - 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 interface IClaimsManagerAPI
      Parameters:
      dimension - the dimension ID of the chunk, not null
      chunkPos - 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 interface IClaimsManagerAPI
      Parameters:
      dimension - the dimension ID of the chunk, not null
      blockPos - 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 interface IClaimsManagerAPI
      Parameters:
      dimension - the dimension ID, not null
      Returns:
      the dimension claims manager, null if no claim data exists for the specified dimension
    • getDimensionStream

      @Nonnull Stream<IServerDimensionClaimsManagerAPI> getDimensionStream()
      Gets a stream of all read-only dimension claims managers.
      Returns:
      a Stream of all read-only dimension claims managers
    • getTracker

      @Nonnull IClaimsManagerTrackerAPI 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 interface IClaimsManagerAPI
      Returns:
      the claim change tracker
    • getDefaultName

      @Nonnull net.minecraft.network.chat.Component getDefaultName(@Nullable IPlayerChunkClaimAPI claimState)
      Description copied from interface: IClaimsManagerAPI
      Gets the default display name that would be used for a provided claim state.

      Calling this method is the equivalent of calling IClaimsManagerAPI.getDefaultName(IPlayerChunkClaimAPI, boolean) with allowPartyNames as true.

      Specified by:
      getDefaultName in interface IClaimsManagerAPI
      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)
      Description copied from interface: IClaimsManagerAPI
      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.

      Specified by:
      getDefaultName in interface IClaimsManagerAPI
      Parameters:
      claimState - the claim state, can be null for wilderness
      allowPartyNames - 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)
      Description copied from interface: IClaimsManagerAPI
      Gets the default display name that would be used for a provided claim UUID.

      Calling this method is the equivalent of calling IClaimsManagerAPI.getDefaultName(UUID, boolean, boolean) with allowPartyNames as true.

      Specified by:
      getDefaultName in interface IClaimsManagerAPI
      Parameters:
      claimId - the UUID of the claimer owner, null for wilderness
      forceloadable - 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)
      Description copied from interface: IClaimsManagerAPI
      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.

      Specified by:
      getDefaultName in interface IClaimsManagerAPI
      Parameters:
      claimId - the UUID of the claimer owner, null for wilderness
      forceloadable - whether to get the default name for a forceloaded claim
      allowPartyNames - 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)
      Description copied from interface: IClaimsManagerAPI
      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 IClaimsManagerAPI.getFullName(IPlayerChunkClaimAPI, boolean) with allowPartyNames as true.

      Specified by:
      getFullName in interface IClaimsManagerAPI
      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)
      Description copied from interface: IClaimsManagerAPI
      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 IClaimsManagerAPI.getFullName(IPlayerChunkClaimAPI, ResourceLocation, boolean) instead for that.

      Specified by:
      getFullName in interface IClaimsManagerAPI
      Parameters:
      claimState - the claim state, can be null for wilderness
      allowPartyNames - 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)
      Description copied from interface: IClaimsManagerAPI
      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.

      Specified by:
      getFullName in interface IClaimsManagerAPI
      Parameters:
      claimState - the claim state, can be null for wilderness
      dimension - the dimension the claim is in, null when doesn't matter
      allowPartyNames - whether to apply party names to party-owned claims
      Returns:
      the full display name, not null
    • getColor

      int getColor(@Nullable IPlayerChunkClaimAPI claimState, @Nullable net.minecraft.resources.ResourceLocation dimension)
      Description copied from interface: IClaimsManagerAPI
      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.

      Specified by:
      getColor in interface IClaimsManagerAPI
      Parameters:
      claimState - the claim state, can be null for wilderness
      dimension - the dimension the claim is in, null when doesn't matter
      Returns:
      the color of the claim state
    • usingAnchorBasedClaiming

      boolean usingAnchorBasedClaiming()
      Description copied from interface: IClaimsManagerAPI
      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.

      Specified by:
      usingAnchorBasedClaiming in interface IClaimsManagerAPI
      Returns:
      true if anchor-based claiming is enabled on the server, otherwise false
    • 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(ResourceLocation, UUID, int, ResourceLocation, int, int, int, int, boolean) or tryToForceload(ResourceLocation, UUID, ResourceLocation, 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to claim as them.

      Parameters:
      dimension - the dimension ID of the chunk, not null
      id - the claim owner UUID, not null
      subConfigIndex - the sub-config index to be used by the claim
      x - the X coordinate of the chunk
      z - the Z coordinate of the chunk
      forceload - 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(ResourceLocation, UUID, ResourceLocation, 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 null
      x - the X coordinate of the chunk
      z - the Z coordinate of the chunk
    • addAnchor

      boolean addAnchor(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull net.minecraft.world.level.ChunkPos pos, @Nonnull UUID playerId)
      Adds a claiming anchor in a specified dimension, at a specified chunk position, for a specified player, if it doesn't already exist there.
      Parameters:
      dimension - the dimension ID for the anchor, not null
      pos - the position for the anchor, not null
      playerId - the ID of the player to add the anchor for, not null
      Returns:
      true if the anchor was added, false if the specified position already had an anchor
    • removeAnchor

      boolean removeAnchor(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull net.minecraft.world.level.ChunkPos pos, @Nonnull UUID playerId)
      Removes the claiming anchor in a specified dimension, at a specified chunk position, for a specified player, if it exists.
      Parameters:
      dimension - the dimension ID of the anchor, not null
      pos - the position of the anchor, not null
      playerId - the ID of the player to remove the anchor for, not null
      Returns:
      true if the anchor was removed, false if the specified position didn't have one
    • tryToClaim

      @Deprecated @Nonnull default ClaimResult<IPlayerChunkClaimAPI> tryToClaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int subConfigIndex, int fromX, int fromZ, int x, int z, boolean replace)
      Deprecated.
      Use tryToClaim(ResourceLocation, UUID, int, ResourceLocation, int, int, int, int, boolean) instead 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to claim as them.

      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 null
      playerId - the claiming player's UUID, not null
      subConfigIndex - the sub-config index to be used by the claim
      fromX - the X coordinate of the claiming player's current chunk position
      fromZ - the Z coordinate of the claiming player's current chunk position
      x - the X coordinate of the chunk to claim
      z - the Z coordinate of the chunk to claim
      replace - 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

      @Deprecated @Nonnull default ClaimResult<IPlayerChunkClaimAPI> tryToUnclaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int x, int z, boolean replace)
      Deprecated.
      Use tryToUnclaim(ResourceLocation, UUID, ResourceLocation, int, int, int, int, boolean) instead Tries to unclaim a chunk by a specified player.

      Success is not guaranteed. Different limitations are checked, e.g. maximum claim distance, existing claims.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to unclaim as them.

      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 null
      playerId - the unclaiming player's UUID, not null
      fromX - the X coordinate of the unclaiming player's current chunk position
      fromZ - the Z coordinate of the unclaiming player's current chunk position
      x - the X coordinate of the chunk to unclaim
      z - the Z coordinate of the chunk to unclaim
      replace - 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

      @Deprecated @Nonnull default ClaimResult<IPlayerChunkClaimAPI> tryToForceload(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int fromX, int fromZ, int x, int z, boolean enable, boolean replace)
      Deprecated.
      Use tryToForceload(ResourceLocation, UUID, ResourceLocation, int, int, int, int, boolean, boolean) instead 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to (un)forceload as them.

      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 null
      playerId - the forceloading player's UUID, not null
      fromX - the X coordinate of the forceloading player's current chunk position
      fromZ - the Z coordinate of the forceloading player's current chunk position
      x - the X coordinate of the chunk to (un)mark for forceloading
      z - the Z coordinate of the chunk to (un)mark for forceloading
      enable - true to mark for forceloading, false to unmark
      replace - 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

      @Deprecated @Nonnull default 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)
      Deprecated.
      Use tryToClaimArea(ResourceLocation, UUID, int, ResourceLocation, int, int, int, int, int, int, boolean, Consumer) instead 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to claim as them.

      You get a AreaClaimResult containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks, not null
      playerId - the claiming player's UUID, not null
      subConfigIndex - the sub-config index to be used by the claims
      fromX - the X coordinate of the claiming player's current chunk position
      fromZ - the Z coordinate of the claiming player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      replace - 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

      @Deprecated @Nonnull default 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)
      Deprecated.
      Use tryToUnclaimArea(ResourceLocation, UUID, ResourceLocation, int, int, int, int, int, int, boolean, Consumer) instead 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to unclaim as them.

      You get a AreaClaimResult containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks, not null
      playerId - the unclaiming player's UUID, not null
      fromX - the X coordinate of the unclaiming player's current chunk position
      fromZ - the Z coordinate of the unclaiming player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      replace - 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

      @Deprecated @Nonnull default 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)
      Deprecated.
      Use tryToForceloadArea(ResourceLocation, UUID, ResourceLocation, int, int, int, int, int, int, boolean, boolean, Consumer) instead 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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to (un)forceload as them.

      You get a AreaClaimResult containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks, not null
      playerId - the forceloading player's UUID, not null
      fromX - the X coordinate of the forceloading player's current chunk position
      fromZ - the Z coordinate of the forceloading player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      enable - true to mark for forceloading, false to unmark
      replace - 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
    • tryToClaim

      @Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToClaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int subConfigIndex, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int x, int z, boolean force)
      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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to claim as them.

      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 null
      playerId - the claiming player's UUID, not null
      subConfigIndex - the sub-config index to be used by the claim
      fromDimension - the ID of the dimension the claiming player is currently in, not null
      fromX - the X coordinate of the claiming player's current chunk position
      fromZ - the Z coordinate of the claiming player's current chunk position
      x - the X coordinate of the chunk to claim
      z - the Z coordinate of the chunk to claim
      force - whether to ignore most limitations
      Returns:
      the result, not null
    • tryToUnclaim

      @Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToUnclaim(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int x, int z, boolean force)
      Tries to unclaim a chunk by a specified player.

      Success is not guaranteed. Different limitations are checked, e.g. maximum claim distance, existing claims.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to unclaim as them.

      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 null
      playerId - the unclaiming player's UUID, not null
      fromDimension - the ID of the dimension the unclaiming player is currently in, not null
      fromX - the X coordinate of the unclaiming player's current chunk position
      fromZ - the Z coordinate of the unclaiming player's current chunk position
      x - the X coordinate of the chunk to unclaim
      z - the Z coordinate of the chunk to unclaim
      force - whether to ignore most limitations
      Returns:
      the result, not null
    • tryToForceload

      @Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToForceload(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int x, int z, boolean enable, boolean force)
      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.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to (un)forceload as them.

      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 null
      playerId - the forceloading player's UUID, not null
      fromDimension - the ID of the dimension the forceloading player is currently in, not null
      fromX - the X coordinate of the forceloading player's current chunk position
      fromZ - the Z coordinate of the forceloading player's current chunk position
      x - the X coordinate of the chunk to (un)mark for forceloading
      z - the Z coordinate of the chunk to (un)mark for forceloading
      enable - true to mark for forceloading, false to unmark
      force - whether to ignore most limitations
      Returns:
      the result, not null
    • tryToAddAnchor

      @Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToAddAnchor(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int x, int z, boolean force)
      Tries to add a claiming anchor for a chunk by a specified player.

      Success is not guaranteed. Different limitations are checked, e.g. maximum anchor number, maximum claim distance, existing anchors.

      You get a ClaimResult containing a message describing the result.

      Parameters:
      dimension - the dimension ID of the chunk, not null
      playerId - the anchoring player's UUID, not null
      fromDimension - the ID of the dimension the anchoring player is currently in, not null
      fromX - the X coordinate of the anchoring player's current chunk position
      fromZ - the Z coordinate of the anchoring player's current chunk position
      x - the X coordinate of the chunk to add the anchor for
      z - the Z coordinate of the chunk to add the anchor for
      force - whether to ignore most limitations
      Returns:
      the result, not null
    • tryToRemoveAnchor

      @Nonnull ClaimResult<IPlayerChunkClaimAPI> tryToRemoveAnchor(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int x, int z, boolean force, @Nullable Consumer<AreaClaimResult> listener)
      Tries to remove a claiming anchor for a chunk by a specified player.

      Success is not guaranteed. Different limitations are checked, e.g. maximum anchor number, maximum claim distance, existing anchors.

      You get a ClaimResult containing a message describing the initial result of trying to begin the removal process.

      Parameters:
      dimension - the dimension ID of the chunk, not null
      playerId - the unanchoring player's UUID, not null
      fromDimension - the ID of the dimension the unanchoring player is currently in, not null
      fromX - the X coordinate of the unanchoring player's current chunk position
      fromZ - the Z coordinate of the unanchoring player's current chunk position
      x - the X coordinate of the chunk to remove the anchor for
      z - the Z coordinate of the chunk to remove the anchor for
      force - whether to ignore most limitations
      listener - listener for the final result, can be null
      Returns:
      the initial result of trying to begin the removal process, not null
    • tryToClaimArea

      void tryToClaimArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, int subConfigIndex, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int left, int top, int right, int bottom, boolean force, @Nonnull Consumer<AreaClaimResult> listener)
      Tries to claim chunks over a specified area as a specified player.

      The effect of calling this method is not immediate, and it may take many server ticks before the result is passed to a provided listener.

      Success is not guaranteed. Different limitations are checked, e.g. maximum claim number, maximum claim distance, existing claims.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to claim as them.

      When the claiming process is complete, an AreaClaimResult is passed to the provided listener containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks to claim, not null
      playerId - the claiming player's UUID, not null
      subConfigIndex - the sub-config index to be used by the claims
      fromDimension - the ID of the dimension the claiming player is currently in, not null
      fromX - the X coordinate of the claiming player's current chunk position
      fromZ - the Z coordinate of the claiming player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      force - whether to ignore most limitations
      listener - the claiming result listener, not null
    • tryToUnclaimArea

      void tryToUnclaimArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int left, int top, int right, int bottom, boolean force, @Nonnull Consumer<AreaClaimResult> listener)
      Tries to unclaim chunks over a specified area by a specified player.

      The effect of calling this method is not immediate, and it may take many server ticks before the result is passed to a provided listener.

      Success is not guaranteed. Different limitations are checked, e.g. maximum claim distance, existing claims.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to unclaim as them.

      When the unclaiming process is complete, an AreaClaimResult is passed to the provided listener containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks to unclaim, not null
      playerId - the unclaiming player's UUID, not null
      fromDimension - the ID of the dimension the unclaiming player is currently in, not null
      fromX - the X coordinate of the unclaiming player's current chunk position
      fromZ - the Z coordinate of the unclaiming player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      force - whether to ignore most limitations
      listener - the claiming result listener, not null
    • tryToForceloadArea

      void tryToForceloadArea(@Nonnull net.minecraft.resources.ResourceLocation dimension, @Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation fromDimension, int fromX, int fromZ, int left, int top, int right, int bottom, boolean enable, boolean force, @Nonnull Consumer<AreaClaimResult> listener)
      Tries to (un)mark chunks for forceloading over a specified area by a specified player.

      The effect of calling this method is not immediate, and it may take many server ticks before the result is passed to a provided listener.

      Success is not guaranteed. Different limitations are checked, e.g. maximum forceload number, maximum claim distance, existing claims.

      Special claim owners can be found at SpecialClaimOwners, such as for server claims, in case you wish to (un)forceload as them.

      When the forceload (un)marking process is complete, an AreaClaimResult is passed to the provided listener containing all unique result types, which contain messages describing the results.

      Parameters:
      dimension - the dimension ID of the chunks to forceload, not null
      playerId - the forceloading player's UUID, not null
      fromDimension - the ID of the dimension the forceloading player is currently in, not null
      fromX - the X coordinate of the forceloading player's current chunk position
      fromZ - the Z coordinate of the forceloading player's current chunk position
      left - the lowest X coordinate of the area
      top - the lowest Z coordinate of the area
      right - the highest X coordinate of the area
      bottom - the highest Z coordinate of the area
      enable - true to mark for forceloading, false to unmark
      force - whether to ignore most limitations
      listener - the claiming result listener, not null
    • getPlayerBaseClaimLimit

      int getPlayerBaseClaimLimit(@Nonnull UUID playerId)
      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 a supported permission 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 a supported permission 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

      int getPlayerBaseForceloadLimit(@Nonnull UUID playerId)
      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 a supported permission 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 a supported permission 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
    • getPlayerBaseAnchorLimit

      int getPlayerBaseAnchorLimit(@Nonnull UUID playerId)
      Gets the base maximum claiming anchor number (without the bonus) for a player UUID.

      By default, the base claiming anchor limit is configured in this mod's server config file. However, if a supported permission 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 claiming anchor number
    • getPlayerBaseAnchorLimit

      int getPlayerBaseAnchorLimit(@Nonnull net.minecraft.server.level.ServerPlayer player)
      Gets the base maximum claiming anchor number (without the bonus) for a logged in player.

      By default, the base claiming anchor limit is configured in this mod's server config file. However, if a supported permission 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 claiming anchor number
    • getPlayerBaseAnchorRange

      int getPlayerBaseAnchorRange(@Nonnull UUID playerId)
      Gets the base claiming anchor range (without the bonus) for a player UUID.

      By default, the base claiming anchor range is configured in this mod's server config file. However, if a supported permission 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 claiming anchor range
    • getPlayerBaseAnchorRange

      int getPlayerBaseAnchorRange(@Nonnull net.minecraft.server.level.ServerPlayer player)
      Gets the base claiming anchor range (without the bonus) for a logged in player.

      By default, the base claiming anchor range is configured in this mod's server config file. However, if a supported permission 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 claiming anchor range
    • getPlayerFullClaimLimit

      int getPlayerFullClaimLimit(@Nonnull UUID playerId)
      Gets the full maximum claim number (with the bonus) for a player UUID.

      The returned value is equal to the value returned by getPlayerBaseClaimLimit(UUID) with the bonus claims added to it.

      Parameters:
      playerId - the player UUID, not null
      Returns:
      the full maximum claim number
    • getPlayerFullClaimLimit

      int getPlayerFullClaimLimit(@Nonnull net.minecraft.server.level.ServerPlayer player)
      Gets the full maximum claim number (with the bonus) for a logged in player.

      The returned value is equal to the value returned by getPlayerBaseClaimLimit(ServerPlayer) with the bonus claims added to it.

      Parameters:
      player - the player, not null
      Returns:
      the full maximum claim number
    • getPlayerFullForceloadLimit

      int getPlayerFullForceloadLimit(@Nonnull UUID playerId)
      Gets the full maximum forceload number (with the bonus) for a player UUID.

      The returned value is equal to the value returned by getPlayerBaseForceloadLimit(UUID) with the bonus forceloads added to it.

      Parameters:
      playerId - the player UUID, not null
      Returns:
      the full maximum forceload number
    • getPlayerFullForceloadLimit

      int getPlayerFullForceloadLimit(@Nonnull net.minecraft.server.level.ServerPlayer player)
      Gets the full maximum forceload number (with the bonus) for a logged in player.

      The returned value is equal to the value returned by getPlayerBaseForceloadLimit(ServerPlayer) with the bonus forceloads added to it.

      Parameters:
      player - the player, not null
      Returns:
      the full maximum forceload number
    • getPlayerFullAnchorLimit

      int getPlayerFullAnchorLimit(@Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation dimension)
      Gets the full maximum claiming anchor number (with the bonus) for a player UUID and dimension.

      The returned value is equal to the value returned by getPlayerBaseAnchorLimit(UUID) with the bonus claiming anchors added to it, which includes the player's own config bonus and the wilderness config bonus.

      Parameters:
      playerId - the player UUID, not null
      dimension - the dimension ID to get the limit for, not null
      Returns:
      the full maximum claiming anchor number
    • getPlayerFullAnchorLimit

      int getPlayerFullAnchorLimit(@Nonnull net.minecraft.server.level.ServerPlayer player, @Nonnull net.minecraft.resources.ResourceLocation dimension)
      Gets the full maximum claiming anchor number (with the bonus) for a logged in player and dimension.

      The returned value is equal to the value returned by getPlayerBaseAnchorLimit(ServerPlayer) with the bonus claiming anchors added to it, which includes the player's own config bonus and the wilderness config bonus.

      Parameters:
      player - the player, not null
      dimension - the dimension ID to get the limit for, not null
      Returns:
      the full maximum claiming anchor number
    • getPlayerFullAnchorRange

      int getPlayerFullAnchorRange(@Nonnull UUID playerId, @Nonnull net.minecraft.resources.ResourceLocation dimension)
      Gets the full claiming anchor range (with the bonus) for a player UUID and dimension.

      The returned value is equal to the value returned by getPlayerBaseAnchorRange(UUID) with the bonus anchor range added to it, which includes the player's own config bonus and the wilderness config bonus.

      Parameters:
      playerId - the player UUID, not null
      dimension - the dimension ID to get the range for, not null
      Returns:
      the full claiming anchor range
    • getPlayerFullAnchorRange

      int getPlayerFullAnchorRange(@Nonnull net.minecraft.server.level.ServerPlayer player, @Nonnull net.minecraft.resources.ResourceLocation dimension)
      Gets the full claiming anchor range (with the bonus) for a logged in player and dimension.

      The returned value is equal to the value returned by getPlayerBaseAnchorRange(ServerPlayer) with the bonus anchor range added to it, which includes the player's own config bonus and the wilderness config bonus.

      Parameters:
      player - the player, not null
      dimension - the dimension ID to get the range for, not null
      Returns:
      the full claiming anchor range
    • getActionListenerManager

      @Nonnull IClaimActionListenerManagerAPI getActionListenerManager()
      Gets the API for the claim action listener manager for this claims manager where you can register claim action listeners.
      Returns:
      the API for the claim action listener manager, not null
    • getChunkAccessOverriderManager

      @Nonnull IChunkAccessOverriderManagerAPI getChunkAccessOverriderManager()
      Gets the API for the chunk access overrider manager for this claims manager where you can register your chunk access overriders.
      Returns:
      the API for the chunk access overrider manager, not null