Interface IServerClaimsManagerAPI

All Superinterfaces:
IClaimsManagerAPI

public interface IServerClaimsManagerAPI extends IClaimsManagerAPI
API for the claims manager on the server side
  • Method Summary

    Modifier and Type
    Method
    Description
    claim(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
    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
    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

      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
    • 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) or tryToForceload(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 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(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 null
      x - the X coordinate of the chunk
      z - 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 null
      playerId - the claiming player 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

      @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 null
      playerId - the unclaiming player 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

      @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 null
      playerId - the claiming player UUID, 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 (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

      @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 null
      playerId - the claiming player 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

      @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 null
      playerId - the claiming player 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

      @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 null
      playerId - the claiming player 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
      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
    • 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 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

      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 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