Class GraveManager
java.lang.Object
com.minecolonies.core.colony.managers.GraveManager
- All Implemented Interfaces:
IGraveManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNewGrave(@NotNull net.minecraft.core.BlockPos pos) Add a grave from the Colony.net.minecraft.core.BlockPoscreateCitizenGrave(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, ICitizenData citizenData) Attempt to create a TileEntityGrave at @pos containing the specific @citizenDataReturns a map with all graves within the colony.voidonColonyTick(IColony colony) Ticks all grave when this building manager receives a tick.voidread(@NotNull net.minecraft.nbt.CompoundTag compound) Read the graves from NBT.voidremoveGrave(@NotNull net.minecraft.core.BlockPos pos) Remove a TileEntityGrave from the Colony (when it is destroyed).booleanreserveGrave(@NotNull net.minecraft.core.BlockPos pos) Reserve a gravenet.minecraft.core.BlockPosReserve the next free gravevoidunReserveGrave(@NotNull net.minecraft.core.BlockPos pos) Un-Reserve a gravevoidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Write the graves to NBT.
-
Constructor Details
-
GraveManager
Creates the GraveManager for a colony.- Parameters:
colony- the colony.
-
-
Method Details
-
read
public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Read the graves from NBT.- Specified by:
readin interfaceIGraveManager- Parameters:
compound- the compound.
-
write
public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Write the graves to NBT.- Specified by:
writein interfaceIGraveManager- Parameters:
compound- the compound.
-
onColonyTick
Ticks all grave when this building manager receives a tick.- Specified by:
onColonyTickin interfaceIGraveManager- Parameters:
colony- the colony which is being ticked.
-
getGraves
Returns a map with all graves within the colony. Key is ID (Coordinates), value is isReserved boolean.- Specified by:
getGravesin interfaceIGraveManager- Returns:
- Map with ID (coordinates) as key, value is isReserved boolean.
-
addNewGrave
public boolean addNewGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Add a grave from the Colony.- Specified by:
addNewGravein interfaceIGraveManager- Parameters:
pos- position of the TileEntityGrave to add.- Returns:
- the grave that was created and added.
-
removeGrave
public void removeGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Remove a TileEntityGrave from the Colony (when it is destroyed).- Specified by:
removeGravein interfaceIGraveManager- Parameters:
pos- position of the TileEntityGrave to remove.
-
reserveGrave
public boolean reserveGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Reserve a grave- Specified by:
reserveGravein interfaceIGraveManager- Parameters:
pos- the id of the grave.- Returns:
- is the grave successfully reserved.
-
unReserveGrave
public void unReserveGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Description copied from interface:IGraveManagerUn-Reserve a grave- Specified by:
unReserveGravein interfaceIGraveManager- Parameters:
pos- the id of the grave.
-
reserveNextFreeGrave
public net.minecraft.core.BlockPos reserveNextFreeGrave()Reserve the next free grave- Specified by:
reserveNextFreeGravein interfaceIGraveManager- Returns:
- the grave successfully reserved or null if none available
-
createCitizenGrave
public net.minecraft.core.BlockPos createCitizenGrave(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, ICitizenData citizenData) Attempt to create a TileEntityGrave at @pos containing the specific @citizenDataOn failure: drop all the citizen inventory on the ground.
- Specified by:
createCitizenGravein interfaceIGraveManager- Parameters:
world- The world.pos- The position where to spawn a gravecitizenData- The citizenData- Returns:
- position if a grave was created.
-