Class GraveyardManagementModule

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModule
com.minecolonies.core.colony.buildings.modules.GraveyardManagementModule
All Implemented Interfaces:
IBuildingEventsModule, IBuildingModule, IPersistentModule, IHasDirty

public class GraveyardManagementModule extends AbstractBuildingModule implements IBuildingModule, IPersistentModule, IBuildingEventsModule
The graveyard list module.
  • Constructor Details

    • GraveyardManagementModule

      public GraveyardManagementModule()
  • Method Details

    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Deserialize the module.
      Specified by:
      deserializeNBT in interface IPersistentModule
      Parameters:
      compound - the nbt compound.
    • serializeNBT

      public void serializeNBT(net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IPersistentModule
      Serialize the module from a compound.
      Specified by:
      serializeNBT in interface IPersistentModule
      Parameters:
      compound - the compound.
    • serializeToView

      public void serializeToView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: IBuildingModule
      Serialization method to send the module data to the client side.
      Specified by:
      serializeToView in interface IBuildingModule
      Parameters:
      buf - the buffer to write it to.
    • migrateLegacyGravePositions

      public void migrateLegacyGravePositions(net.minecraft.nbt.CompoundTag compound)
      Migrates burial plot positions stored on the graveyard building before ownership moved to this module.
      Parameters:
      compound - the legacy building data.
    • getGravePositions

      public Set<Tuple<net.minecraft.core.BlockPos,net.minecraft.core.Direction>> getGravePositions()
      Get the burial plot positions and their directions.
      Returns:
      the burial plot positions.
    • registerGravePosition

      public void registerGravePosition(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos)
      Register a named grave block as a burial plot.
      Parameters:
      state - the block state.
      pos - the block position.
    • getRandomFreeVisualGravePos

      @Nullable public @Nullable Tuple<net.minecraft.core.BlockPos,net.minecraft.core.Direction> getRandomFreeVisualGravePos()
      Return a random free visual grave position.
      Returns:
      a free burial plot, or null when none are available.
    • setLastGraveData

      public void setLastGraveData(GraveData graveData)
      Setter for the last grave data.
      Parameters:
      graveData - the last grave the worker has dug.
    • getLastGraveData

      public GraveData getLastGraveData()
      Get for the last grave.
      Returns:
      the last grave the worker has dug.
    • hasRestingCitizen

      public boolean hasRestingCitizen(Set<String> citizens)
      Check if one of the citizens in the list is resting.
      Parameters:
      citizens - the citizens to check.
      Returns:
      true if so.
    • buryCitizenHere

      public boolean buryCitizenHere(Tuple<net.minecraft.core.BlockPos,net.minecraft.core.Direction> positionAndDirection, AbstractEntityCitizen worker)
      Add a citizen to the list of resting citizens in this graveyard.
      Parameters:
      positionAndDirection - the burial plot position and grave direction.
      worker - the undertaker performing the burial.
      Returns:
      true if the named grave was placed and the burial was recorded; otherwise false.