Interface ICitizenDiseaseHandler
- All Known Implementing Classes:
CitizenDiseaseHandler
public interface ICitizenDiseaseHandler
Citizen disease handler interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcure()Cure the citizen.@Nullable DiseaseGet the current disease, if any.booleanisHurt()True when the citizen needs to go to a hospital because its hurtbooleanisSick()Check if the citizen is sick and must be healed..voidonCollission(ICitizenData citizen) Called when two citizens collide.voidread(net.minecraft.nbt.CompoundTag compound) Read the handler from NBT.booleansetDisease(Disease disease) Set a disease on the citizen.voidsetSleepsAtHospital(boolean isAtHospital) Sets a flag that the citizen is now at the hospital.booleanWhether the citizen sleeps at a hospitalvoidupdate(int tickRate) To tick the handler.voidwrite(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
Get the current disease, if any.- Returns:
- the disease instance.
-
cure
void cure()Cure the citizen. -
onCollission
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
Set a disease on the citizen.- Parameters:
disease- to set.- Returns:
- true if they actually became sick.
-