All Implemented Interfaces:
IBuilding, IBuildingContainer, ICommonBuilding, ISchematicProvider, IBuildingModuleContainer, IModuleContainer<IBuildingModule>, IRequester, IRequestResolverProvider, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class BuildingHospital extends AbstractBuilding
Class of the hospital building.
  • Constructor Details

    • BuildingHospital

      public BuildingHospital(IColony c, net.minecraft.core.BlockPos l)
      Instantiates a new hospital building.
      Parameters:
      c - the colony.
      l - the location
  • Method Details

    • getSchematicName

      @NotNull public @NotNull String getSchematicName()
      Description copied from interface: ISchematicProvider
      Children must return the name of their structure.
      Returns:
      StructureProxy name.
    • getMaxBuildingLevel

      public int getMaxBuildingLevel()
      Description copied from interface: ISchematicProvider
      Children must return their max building level.
      Specified by:
      getMaxBuildingLevel in interface ISchematicProvider
      Overrides:
      getMaxBuildingLevel in class AbstractBuilding
      Returns:
      Max building level.
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag compound)
      Specified by:
      deserializeNBT in interface IBuildingContainer
      Specified by:
      deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      deserializeNBT in class AbstractBuilding
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface IBuildingContainer
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
      Overrides:
      serializeNBT in class AbstractBuilding
    • registerBlockPosition

      public void registerBlockPosition(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState blockState, @NotNull @NotNull net.minecraft.core.BlockPos pos, @NotNull @NotNull net.minecraft.world.level.Level world)
      Description copied from interface: IBuildingContainer
      Register a blockState and position. We suppress this warning since this parameter will be used in child classes which override this method.
      Specified by:
      registerBlockPosition in interface IBuildingContainer
      Overrides:
      registerBlockPosition in class AbstractBuilding
      Parameters:
      blockState - to be registered
      pos - of the blockState
      world - world to register it at.
    • getBedList

      @NotNull public @NotNull List<net.minecraft.core.BlockPos> getBedList()
      Get the list of beds.
      Returns:
      immutable copy
    • getPatients

      public List<Patient> getPatients()
      Get the list of patient files.
      Returns:
      immutable copy.
    • removePatientFile

      public void removePatientFile(Patient patient)
      Remove a patient from the list.
      Parameters:
      patient - the patient to remove.
    • getRequiredItemsAndAmount

      public Map<Predicate<net.minecraft.world.item.ItemStack>,net.minecraft.util.Tuple<Integer,Boolean>> getRequiredItemsAndAmount()
      Description copied from class: AbstractBuilding
      Override this method if you want to keep an amount of items in inventory. When the inventory is full, everything get's dumped into the building chest. But you can use this method to hold some stacks back.
      Specified by:
      getRequiredItemsAndAmount in interface IBuilding
      Overrides:
      getRequiredItemsAndAmount in class AbstractBuilding
      Returns:
      a list of objects which should be kept.
    • checkOrCreatePatientFile

      public void checkOrCreatePatientFile(int citizenId)
      Add a new patient to the list.
      Parameters:
      citizenId - patient to add.
    • registerPatient

      public void registerPatient(net.minecraft.core.BlockPos bedPos, int citizenId)
      Register a citizen.
      Parameters:
      bedPos - the pos.
      citizenId - the citizen id.
    • onWakeUp

      public void onWakeUp()
      Description copied from class: AbstractBuilding
      Executed when a new day start.
      Specified by:
      onWakeUp in interface IBuilding
      Overrides:
      onWakeUp in class AbstractBuilding
    • canEat

      public boolean canEat(net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IBuilding
      Check if the assigned citizens are allowed to eat the following stack.
      Parameters:
      stack - the stack to test.
      Returns:
      true if so.