Class ChunkCapData

java.lang.Object
com.minecolonies.api.util.ChunkCapData

public class ChunkCapData extends Object
Wrapper class for chunk pos and colony cap data
  • Field Details

    • x

      public final int x
      Chunk coordinates
    • z

      public final int z
  • Constructor Details

    • ChunkCapData

      public ChunkCapData(int x, int z)
    • ChunkCapData

      public ChunkCapData(int x, int z, int owningColony, List<Integer> staticColonyClaim, @NotNull @NotNull Map<Integer,Set<net.minecraft.core.BlockPos>> allClaimingBuildings)
  • Method Details

    • toBytes

      public void toBytes(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Writes data to a buffer
      Parameters:
      buf - the buffer to write it to.
    • fromBytes

      public static ChunkCapData fromBytes(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buffer)
      Creates the data from a buffer
      Parameters:
      buffer - the bytebuffer.
      Returns:
      the cap data.
    • getStaticColonyClaim

      public List<Integer> getStaticColonyClaim()
      Getter for static claim.
      Returns:
      list.
    • getOwningColony

      public int getOwningColony()
      Getter for owning colony id.
      Returns:
      the id.
    • getAllClaimingBuildings

      public Map<Integer,Set<net.minecraft.core.BlockPos>> getAllClaimingBuildings()
      Getter for all claimed buildings.
      Returns:
      the map.