Interface IGraveManager

All Known Implementing Classes:
GraveManager, GraveManagerView

public interface IGraveManager
Interface for grave managers.
  • 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)
    Read the graves from NBT.
    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.
  • 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

      void onColonyTick(IColony colony)
      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 grave
      citizenData - The citizenData
      Returns:
      position if a grave was created.
    • getGraves

      @NotNull @NotNull Map<net.minecraft.core.BlockPos,Boolean> 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.