Package com.minecolonies.core.colony
Class GraveManagerView
java.lang.Object
com.minecolonies.core.colony.GraveManagerView
- All Implemented Interfaces:
IGraveManager
Client-side read-only copy of the
GraveManager.-
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 @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) This needs to read whatGraveManager.write(net.minecraft.nbt.CompoundTag)wrote.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.
-
Constructor Details
-
GraveManagerView
public GraveManagerView()
-
-
Method Details
-
read
public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) This needs to read whatGraveManager.write(net.minecraft.nbt.CompoundTag)wrote.- Specified by:
readin interfaceIGraveManager- Parameters:
compound- the compound.
-
write
public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Description copied from interface:IGraveManagerWrite the graves to NBT.- Specified by:
writein interfaceIGraveManager- Parameters:
compound- the compound.
-
onColonyTick
Description copied from interface:IGraveManagerTick the graves on colony tick.- Specified by:
onColonyTickin interfaceIGraveManager- Parameters:
colony- the event.
-
reserveGrave
public boolean reserveGrave(net.minecraft.core.BlockPos pos) Description copied from interface:IGraveManagerReserve a grave- Specified by:
reserveGravein interfaceIGraveManager- Parameters:
pos- the id of the grave.- Returns:
- is the grave successfully reserved.
-
unReserveGrave
public void unReserveGrave(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()Description copied from interface:IGraveManagerReserve 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) Description copied from interface:IGraveManagerAttempt to create a TileEntityGrave at @pos containing the specific @citizenData On 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.
-
getGraves
Description copied from interface:IGraveManagerReturns 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) Description copied from interface:IGraveManagerAdd 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) Description copied from interface:IGraveManagerRemove a TileEntityGrave from the Colony (when it is destroyed).- Specified by:
removeGravein interfaceIGraveManager- Parameters:
pos- position of the TileEntityGrave to remove.
-