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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk) Add the building claim of a certain building.voidaddColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk) Add a new colony to the chunk.voiddeSerialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Deserialize claims from buffervoiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) Get the claiming buildings map.intGet the owning colony.Get a list of colonies with a static claim.voidremoveBuildingClaim(int colonyId, net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk chunk) Remove the building claim of a certain building.voidremoveColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk) Remove a colony from the list.voidreset(net.minecraft.world.level.chunk.LevelChunk chunk) Reset the capability.voidserialize(net.minecraft.network.RegistryFriendlyByteBuf buf) Serialize data to buffernet.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) voidsetOwningColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk) Set the owning colony.voidsetStaticColonyClaim(List<Integer> colonies) Sets all close colonies.
-
Constructor Details
-
ChunkClaimData
public ChunkClaimData()
-
-
Method Details
-
addColony
public void addColony(int id, net.minecraft.world.level.chunk.LevelChunk chunk) Description copied from interface:IChunkClaimDataAdd a new colony to the chunk. Only relevant in non dynamic claiming.- Specified by:
addColonyin interfaceIChunkClaimData- 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:IChunkClaimDataRemove a colony from the list. Only relevant in non dynamic claiming.- Specified by:
removeColonyin interfaceIChunkClaimData- Parameters:
id- the id to remove.chunk- the chunk to remove it from.
-
setStaticColonyClaim
Description copied from interface:IChunkClaimDataSets all close colonies.- Specified by:
setStaticColonyClaimin interfaceIChunkClaimData- Parameters:
colonies- the set of colonies.
-
reset
public void reset(net.minecraft.world.level.chunk.LevelChunk chunk) Description copied from interface:IChunkClaimDataReset the capability.- Specified by:
resetin interfaceIChunkClaimData- 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:IChunkClaimDataAdd the building claim of a certain building.- Specified by:
addBuildingClaimin interfaceIChunkClaimData- 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:IChunkClaimDataRemove the building claim of a certain building.- Specified by:
removeBuildingClaimin interfaceIChunkClaimData- 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:IChunkClaimDataSet the owning colony.- Specified by:
setOwningColonyin interfaceIChunkClaimData- Parameters:
id- the id to set.chunk- the chunk to set it for.
-
getOwningColony
public int getOwningColony()Description copied from interface:IChunkClaimDataGet the owning colony.- Specified by:
getOwningColonyin interfaceIChunkClaimData- Returns:
- the id of it.
-
getStaticClaimColonies
Description copied from interface:IChunkClaimDataGet a list of colonies with a static claim.- Specified by:
getStaticClaimColoniesin interfaceIChunkClaimData- Returns:
- a list of their ids.
-
getAllClaimingBuildings
Description copied from interface:IChunkClaimDataGet the claiming buildings map.- Specified by:
getAllClaimingBuildingsin interfaceIChunkClaimData- Returns:
- the entire map.
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.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:
deserializeNBTin interfacenet.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-
-