Class GraveManagerView

java.lang.Object
com.minecolonies.core.colony.GraveManagerView
All Implemented Interfaces:
IGraveManager

public class GraveManagerView extends Object implements IGraveManager
Client-side read-only copy of the GraveManager.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addNewGrave(@NotNull net.minecraft.core.BlockPos pos)
    Add a grave from the Colony.
    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.
    @NotNull Map<net.minecraft.core.BlockPos,Boolean>
    Returns a map with all graves within the colony.
    void
    Tick the graves on colony tick.
    void
    read(@NotNull net.minecraft.nbt.CompoundTag compound)
    void
    removeGrave(@NotNull net.minecraft.core.BlockPos pos)
    Remove a TileEntityGrave from the Colony (when it is destroyed).
    boolean
    reserveGrave(net.minecraft.core.BlockPos pos)
    Reserve a grave
    net.minecraft.core.BlockPos
    Reserve the next free grave
    void
    unReserveGrave(net.minecraft.core.BlockPos pos)
    Un-Reserve a grave
    void
    write(@NotNull net.minecraft.nbt.CompoundTag compound)
    Write the graves to NBT.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GraveManagerView

      public GraveManagerView()
  • Method Details

    • read

      public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Specified by:
      read in interface IGraveManager
      Parameters:
      compound - the compound.
    • write

      public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Description copied from interface: IGraveManager
      Write the graves to NBT.
      Specified by:
      write in interface IGraveManager
      Parameters:
      compound - the compound.
    • onColonyTick

      public void onColonyTick(IColony colony)
      Description copied from interface: IGraveManager
      Tick the graves on colony tick.
      Specified by:
      onColonyTick in interface IGraveManager
      Parameters:
      colony - the event.
    • reserveGrave

      public boolean reserveGrave(net.minecraft.core.BlockPos pos)
      Description copied from interface: IGraveManager
      Reserve a grave
      Specified by:
      reserveGrave in interface IGraveManager
      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: IGraveManager
      Un-Reserve a grave
      Specified by:
      unReserveGrave in interface IGraveManager
      Parameters:
      pos - the id of the grave.
    • reserveNextFreeGrave

      public net.minecraft.core.BlockPos reserveNextFreeGrave()
      Description copied from interface: IGraveManager
      Reserve the next free grave
      Specified by:
      reserveNextFreeGrave in interface IGraveManager
      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: IGraveManager
      Attempt to create a TileEntityGrave at @pos containing the specific @citizenData On failure: drop all the citizen inventory on the ground.
      Specified by:
      createCitizenGrave in interface IGraveManager
      Parameters:
      world - The world.
      pos - The position where to spawn a grave
      citizenData - The citizenData
      Returns:
      position if a grave was created.
    • getGraves

      @NotNull public @NotNull Map<net.minecraft.core.BlockPos,Boolean> getGraves()
      Description copied from interface: IGraveManager
      Returns a map with all graves within the colony. Key is ID (Coordinates), value is isReserved boolean.
      Specified by:
      getGraves in interface IGraveManager
      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: IGraveManager
      Add a grave from the Colony.
      Specified by:
      addNewGrave in interface IGraveManager
      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: IGraveManager
      Remove a TileEntityGrave from the Colony (when it is destroyed).
      Specified by:
      removeGrave in interface IGraveManager
      Parameters:
      pos - position of the TileEntityGrave to remove.