Interface IClientClaimsManagerAPI

All Superinterfaces:
IClaimsManagerAPI

public interface IClientClaimsManagerAPI extends IClaimsManagerAPI
API for the claims manager on the client side
  • 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 IClientPlayerClaimInfoAPI 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<IClientPlayerClaimInfoAPI> 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 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 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<IClientDimensionClaimsManagerAPI> 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
    • 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
    • getClaimCount

      int getClaimCount()
      Gets the claim count of the local client player.

      This is not necessarily up-to-date with the actual synced claim data at the time of calling.

      Returns:
      the claim count of the player
    • getForceloadCount

      int getForceloadCount()
      Gets the forceload count of the local client player.

      This is not necessarily up-to-date with the actual synced claim data at the time of calling.

      Returns:
      the forceload count of the player
    • 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
    • getClaimCount

      int getClaimCount(@Nonnull IClaimingModeAPI mode)
      Gets the claim count for a specified claiming mode.

      This is not necessarily up-to-date with the actual synced claim data at the time of calling.

      Parameters:
      mode - the claiming mode, not null
      Returns:
      the claim count for the mode
    • getForceloadCount

      int getForceloadCount(@Nonnull IClaimingModeAPI mode)
      Gets the forceload count for a specified claiming mode.

      This is not necessarily up-to-date with the actual synced claim data at the time of calling.

      Parameters:
      mode - the claiming mode, not null
      Returns:
      the forceload count for the mode
    • getClaimLimit

      int getClaimLimit(@Nonnull IClaimingModeAPI mode)
      Gets the claim limit for a specified claiming mode.
      Parameters:
      mode - the claiming mode, not null
      Returns:
      the claim limit for the mode
    • getForceloadLimit

      int getForceloadLimit(@Nonnull IClaimingModeAPI mode)
      Gets the forceload limit for a specified claiming mode.
      Parameters:
      mode - the claiming mode, not null
      Returns:
      the forceload limit for the mode
    • 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

      @Deprecated boolean isServerMode()
      Deprecated.
      Use getClaimingMode() instead

      Checks whether the local client player is in server claim mode.

      Returns:
      true if the player is in server claim mode, otherwise false
    • getClaimingMode

      @Nonnull IClaimingModeAPI getClaimingMode()
      Gets the currently enabled effective claiming mode.
      Returns:
      the current effective claiming mode, not null
    • getRawClaimingMode

      @Nullable IClaimingModeAPI getRawClaimingMode()
      Gets the currently enabled claiming mode without automatically determining the effective one if none is set.
      Returns:
      the current claiming mode, null if none is set
    • getClaimResultTracker

      @Nonnull IClaimsManagerClaimResultTrackerAPI 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

      @Deprecated default void requestClaim(int x, int z, boolean byServer)
      Deprecated.
      switch to requestClaim(int, int, IClaimingModeAPI)

      Requests a new chunk claim by the local client player, party 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 chunk
      z - the Z coordinate of the chunk
      byServer - whether the claim should be made by the server
    • requestUnclaim

      @Deprecated default void requestUnclaim(int x, int z, boolean byServer)
      Deprecated.
      switch to requestUnclaim(int, int, IClaimingModeAPI)

      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 chunk
      z - the Z coordinate of the chunk
      byServer - whether the unclaim should be made by the server
    • requestForceload

      @Deprecated default void requestForceload(int x, int z, boolean enable, boolean byServer)
      Deprecated.
      switch to requestForceload(int, int, boolean, IClaimingModeAPI)

      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 chunk
      z - the Z coordinate of the chunk
      enable - true to forceload the chunk, false to unforceload
      byServer - whether the (un)forceload should be made by the server
    • requestAreaClaim

      @Deprecated default void requestAreaClaim(int left, int top, int right, int bottom, boolean byServer)
      Deprecated.
      switch to requestAreaClaim(int, int, int, int, IClaimingModeAPI)

      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 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
      byServer - whether the claim should be made by the server
    • requestAreaUnclaim

      @Deprecated default void requestAreaUnclaim(int left, int top, int right, int bottom, boolean byServer)
      Deprecated.
      switch to requestAreaUnclaim(int, int, int, int, IClaimingModeAPI)

      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 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
      byServer - whether the unclaim should be made by the server
    • requestAreaForceload

      @Deprecated default void requestAreaForceload(int left, int top, int right, int bottom, boolean enable, boolean byServer)
      Deprecated.
      switch to requestAreaForceload(int, int, int, int, boolean, IClaimingModeAPI)

      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 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 forceload the chunks, false to unforceload
      byServer - whether the (un)forceload should be made by the server
    • requestClaim

      void requestClaim(int x, int z, @Nullable IClaimingModeAPI claimingMode)
      Requests a new chunk claim by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      x - the X coordinate of the chunk
      z - the Z coordinate of the chunk
      claimingMode - the claiming mode to use, null for current
    • requestUnclaim

      void requestUnclaim(int x, int z, @Nullable IClaimingModeAPI claimingMode)
      Requests a chunk unclaim by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      x - the X coordinate of the chunk
      z - the Z coordinate of the chunk
      claimingMode - the claiming mode to use, null for current
    • requestForceload

      void requestForceload(int x, int z, boolean enable, @Nullable IClaimingModeAPI claimingMode)
      Requests a chunk (un)forceload by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      x - the X coordinate of the chunk
      z - the Z coordinate of the chunk
      enable - true to forceload the chunk, false to unforceload
      claimingMode - the claiming mode to use, null for current
    • requestAreaClaim

      void requestAreaClaim(int left, int top, int right, int bottom, @Nullable IClaimingModeAPI claimingMode)
      Requests new chunks claims over a specified area by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      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
      claimingMode - the claiming mode to use, null for current
    • requestAreaUnclaim

      void requestAreaUnclaim(int left, int top, int right, int bottom, @Nullable IClaimingModeAPI claimingMode)
      Requests chunk unclaims over a specified area by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      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
      claimingMode - the claiming mode to use, null for current
    • requestAreaForceload

      void requestAreaForceload(int left, int top, int right, int bottom, boolean enable, @Nullable IClaimingModeAPI claimingMode)
      Requests chunk (un)forceloads over a specified area by the local client player using a specified claiming mode.

      Register a claim result listener with IClaimsManagerClaimResultTrackerAPI to receive the result of this request.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      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 forceload the chunks, false to unforceload
      claimingMode - the claiming mode to use, null for current
    • getPotentialClaimStateReflection

      @Nullable IPlayerChunkClaimAPI getPotentialClaimStateReflection()
      Gets a claim state of the same type (see IPlayerChunkClaimAPI.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

      @Deprecated int getCurrentServerSubConfigIndex()
      Deprecated.
      Use getCurrentSubConfigIndex(IClaimingModeAPI) instead

      Gets the index of the sub-config currently used for new server claims.

      Returns:
      the current server sub-config index
    • getCurrentSubConfigIndex

      int getCurrentSubConfigIndex(IClaimingModeAPI claimingMode)
      Gets the index of the sub-config currently used for a specified claiming mode.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      claimingMode - the claiming mode, not null
      Returns:
      the current sub-config index for the claiming mode
    • getCurrentSubConfigId

      @Nonnull String getCurrentSubConfigId()
      Gets the string ID of the sub-config currently used for new claims.
      Returns:
      the current sub-config ID, not null
    • getCurrentServerSubConfigId

      @Deprecated @Nonnull String getCurrentServerSubConfigId()
      Deprecated.
      Use getCurrentSubConfigId(IClaimingModeAPI) instead

      Gets the string ID of the sub-config currently used for new server claims.

      Returns:
      the current server sub-config ID, not null
    • getCurrentSubConfigId

      @Nonnull String getCurrentSubConfigId(IClaimingModeAPI claimingMode)
      Gets the string ID of the sub-config currently used for a specified claiming mode.

      You can get all claiming modes from ClaimingModes.

      Parameters:
      claimingMode - the claiming mode, not null
      Returns:
      the current sub-config ID for the claiming mode, not null
    • getCurrentPartyOwner

      @Nullable UUID getCurrentPartyOwner()
      Gets the UUID of the owner of the primary party that the local player is in.
      Returns:
      the UUID of the local player's party owner, null before synced or when not in party