Class CitizenMournHandler
java.lang.Object
com.minecolonies.core.entity.citizen.citizenhandlers.CitizenMournHandler
- All Implemented Interfaces:
ICitizenMournHandler
The new happiness handler for the citizen.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of the citizen happiness handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeceasedCitizen(String name) Add a deceased citizen to the handler.voidClear the list of deceased citizens.Gets a set with all the recently deceased citizens.booleanCheck if the citizen is already mourning.voidread(net.minecraft.nbt.CompoundTag compound) Read the handler from NBT.voidremoveDeceasedCitizen(String name) Remove a deceased citizen from the handler.voidsetMourning(boolean mourn) Set if the citizen is mourning atm.booleanCheck if the citizen should mourn.voidwrite(net.minecraft.nbt.CompoundTag compound) Write the handler to NBT.
-
Constructor Details
-
CitizenMournHandler
Create a new instance of the citizen happiness handler.- Parameters:
data- the data to handle.
-
-
Method Details
-
read
public void read(net.minecraft.nbt.CompoundTag compound) Description copied from interface:ICitizenMournHandlerRead the handler from NBT.- Specified by:
readin interfaceICitizenMournHandler- Parameters:
compound- the compound to read it from.
-
write
public void write(net.minecraft.nbt.CompoundTag compound) Description copied from interface:ICitizenMournHandlerWrite the handler to NBT.- Specified by:
writein interfaceICitizenMournHandler- Parameters:
compound- the compound to write it to.
-
addDeceasedCitizen
Description copied from interface:ICitizenMournHandlerAdd a deceased citizen to the handler.- Specified by:
addDeceasedCitizenin interfaceICitizenMournHandler- Parameters:
name- the name of the citizen.
-
getDeceasedCitizens
Description copied from interface:ICitizenMournHandlerGets a set with all the recently deceased citizens.- Specified by:
getDeceasedCitizensin interfaceICitizenMournHandler- Returns:
- a set with all the recently deceased citizens.
-
removeDeceasedCitizen
Description copied from interface:ICitizenMournHandlerRemove a deceased citizen from the handler.- Specified by:
removeDeceasedCitizenin interfaceICitizenMournHandler- Parameters:
name- the name of the citizen.
-
clearDeceasedCitizen
public void clearDeceasedCitizen()Description copied from interface:ICitizenMournHandlerClear the list of deceased citizens.- Specified by:
clearDeceasedCitizenin interfaceICitizenMournHandler
-
shouldMourn
public boolean shouldMourn()Description copied from interface:ICitizenMournHandlerCheck if the citizen should mourn.- Specified by:
shouldMournin interfaceICitizenMournHandler- Returns:
- true if so.
-
isMourning
public boolean isMourning()Description copied from interface:ICitizenMournHandlerCheck if the citizen is already mourning.- Specified by:
isMourningin interfaceICitizenMournHandler- Returns:
- true if so.
-
setMourning
public void setMourning(boolean mourn) Description copied from interface:ICitizenMournHandlerSet if the citizen is mourning atm.- Specified by:
setMourningin interfaceICitizenMournHandler- Parameters:
mourn- true if so.
-