Class ChunkClaimData

java.lang.Object
com.minecolonies.api.colony.claim.ChunkClaimData
All Implemented Interfaces:
IChunkClaimData, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class ChunkClaimData extends Object implements IChunkClaimData, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
The implementation of the colonyTagCapability.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk)
    Add the building claim of a certain building.
    void
    addColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
    Add a new colony to the chunk.
    void
    deSerialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Deserialize claims from buffer
    void
    deserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
     
    @NotNull Map<Integer,Set<net.minecraft.core.BlockPos>>
    Get the claiming buildings map.
    int
    Get the owning colony.
    @NotNull List<Integer>
    Get a list of colonies with a static claim.
    void
    removeBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk)
    Remove the building claim of a certain building.
    void
    removeColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
    Remove a colony from the list.
    void
    reset(net.minecraft.world.level.chunk.LevelChunk chunk)
    Reset the capability.
    void
    serialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Serialize data to buffer
    net.minecraft.nbt.CompoundTag
    serializeNBT(net.minecraft.core.HolderLookup.Provider provider)
     
    void
    setOwningColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
    Set the owning colony.
    void
    Sets all close colonies.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChunkClaimData

      public ChunkClaimData()
  • Method Details

    • addColony

      public void addColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Add a new colony to the chunk. Only relevant in non dynamic claiming.
      Specified by:
      addColony in interface IChunkClaimData
      Parameters:
      id - the id to add.
      chunk - the chunk to add it to.
    • removeColony

      public void removeColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Remove a colony from the list. Only relevant in non dynamic claiming.
      Specified by:
      removeColony in interface IChunkClaimData
      Parameters:
      id - the id to remove.
      chunk - the chunk to remove it from.
    • setStaticColonyClaim

      public void setStaticColonyClaim(List<Integer> colonies)
      Description copied from interface: IChunkClaimData
      Sets all close colonies.
      Specified by:
      setStaticColonyClaim in interface IChunkClaimData
      Parameters:
      colonies - the set of colonies.
    • reset

      public void reset(net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Reset the capability.
      Specified by:
      reset in interface IChunkClaimData
      Parameters:
      chunk - the chunk to reset.
    • addBuildingClaim

      public void addBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Add the building claim of a certain building.
      Specified by:
      addBuildingClaim in interface IChunkClaimData
      Parameters:
      colonyId - the colony id.
      pos - the position of the building.
      chunk - the chunk to add the claim for.
    • removeBuildingClaim

      public void removeBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Remove the building claim of a certain building.
      Specified by:
      removeBuildingClaim in interface IChunkClaimData
      Parameters:
      colonyId - the colony id.
      pos - the position of the building.
      chunk - the chunk to remove it from.
    • setOwningColony

      public void setOwningColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk)
      Description copied from interface: IChunkClaimData
      Set the owning colony.
      Specified by:
      setOwningColony in interface IChunkClaimData
      Parameters:
      id - the id to set.
      chunk - the chunk to set it for.
    • getOwningColony

      public int getOwningColony()
      Description copied from interface: IChunkClaimData
      Get the owning colony.
      Specified by:
      getOwningColony in interface IChunkClaimData
      Returns:
      the id of it.
    • getStaticClaimColonies

      @NotNull public @NotNull List<Integer> getStaticClaimColonies()
      Description copied from interface: IChunkClaimData
      Get a list of colonies with a static claim.
      Specified by:
      getStaticClaimColonies in interface IChunkClaimData
      Returns:
      a list of their ids.
    • getAllClaimingBuildings

      @NotNull public @NotNull Map<Integer,Set<net.minecraft.core.BlockPos>> getAllClaimingBuildings()
      Description copied from interface: IChunkClaimData
      Get the claiming buildings map.
      Specified by:
      getAllClaimingBuildings in interface IChunkClaimData
      Returns:
      the entire map.
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • serialize

      public void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Serialize data to buffer
      Parameters:
      buf -
    • deSerialize

      public void deSerialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Deserialize claims from buffer
      Parameters:
      buf -