Interface ICitizenDiseaseHandler

All Known Implementing Classes:
CitizenDiseaseHandler

public interface ICitizenDiseaseHandler
Citizen disease handler interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cure the citizen.
    @Nullable Disease
    Get the current disease, if any.
    boolean
    True when the citizen needs to go to a hospital because its hurt
    boolean
    Check if the citizen is sick and must be healed..
    void
    Called when two citizens collide.
    void
    read(net.minecraft.nbt.CompoundTag compound)
    Read the handler from NBT.
    boolean
    Set a disease on the citizen.
    void
    setSleepsAtHospital(boolean isAtHospital)
    Sets a flag that the citizen is now at the hospital.
    boolean
    Whether the citizen sleeps at a hospital
    void
    update(int tickRate)
    To tick the handler.
    void
    write(net.minecraft.nbt.CompoundTag compound)
    Write the handler to NBT.
  • Method Details

    • update

      void update(int tickRate)
      To tick the handler.
    • isSick

      boolean isSick()
      Check if the citizen is sick and must be healed..
      Returns:
      true if so.
    • write

      void write(net.minecraft.nbt.CompoundTag compound)
      Write the handler to NBT.
      Parameters:
      compound - the nbt to write it to.
    • read

      void read(net.minecraft.nbt.CompoundTag compound)
      Read the handler from NBT.
      Parameters:
      compound - the nbt to read it from.
    • getDisease

      @Nullable @Nullable Disease getDisease()
      Get the current disease, if any.
      Returns:
      the disease instance.
    • cure

      void cure()
      Cure the citizen.
    • onCollission

      void onCollission(ICitizenData citizen)
      Called when two citizens collide.
    • isHurt

      boolean isHurt()
      True when the citizen needs to go to a hospital because its hurt
      Returns:
    • sleepsAtHospital

      boolean sleepsAtHospital()
      Whether the citizen sleeps at a hospital
      Returns:
    • setSleepsAtHospital

      void setSleepsAtHospital(boolean isAtHospital)
      Sets a flag that the citizen is now at the hospital.
    • setDisease

      boolean setDisease(Disease disease)
      Set a disease on the citizen.
      Parameters:
      disease - to set.
      Returns:
      true if they actually became sick.