Interface IGraveManager
- All Known Implementing Classes:
GraveManager,GraveManagerView
public interface IGraveManager
Interface for grave managers.
-
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 @citizenData On failure: drop all the citizen inventory on the ground.Returns a map with all graves within the colony.voidonColonyTick(IColony colony) Tick the graves on colony 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(net.minecraft.core.BlockPos pos) Reserve a gravenet.minecraft.core.BlockPosReserve the next free gravevoidunReserveGrave(net.minecraft.core.BlockPos pos) Un-Reserve a gravevoidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Write the graves to NBT.
-
Method Details
-
read
void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Read the graves from NBT.- Parameters:
compound- the compound.
-
write
void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Write the graves to NBT.- Parameters:
compound- the compound.
-
onColonyTick
Tick the graves on colony tick.- Parameters:
colony- the event.
-
reserveGrave
boolean reserveGrave(net.minecraft.core.BlockPos pos) Reserve a grave- Parameters:
pos- the id of the grave.- Returns:
- is the grave successfully reserved.
-
unReserveGrave
void unReserveGrave(net.minecraft.core.BlockPos pos) Un-Reserve a grave- Parameters:
pos- the id of the grave.
-
reserveNextFreeGrave
net.minecraft.core.BlockPos reserveNextFreeGrave()Reserve the next free grave- Returns:
- the grave successfully reserved or null if none available
-
createCitizenGrave
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 @citizenData On failure: drop all the citizen inventory on the ground.- Parameters:
world- The world.pos- The position where to spawn a gravecitizenData- The citizenData- Returns:
- position if a grave was created.
-
getGraves
Returns a map with all graves within the colony. Key is ID (Coordinates), value is isReserved boolean.- Returns:
- Map with ID (coordinates) as key, value is isReserved boolean.
-
addNewGrave
boolean addNewGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Add a grave from the Colony.- Parameters:
pos- position of the TileEntityGrave to add.- Returns:
- the grave that was created and added.
-
removeGrave
void removeGrave(@NotNull @NotNull net.minecraft.core.BlockPos pos) Remove a TileEntityGrave from the Colony (when it is destroyed).- Parameters:
pos- position of the TileEntityGrave to remove.
-