Interface ICitizenHappinessHandler
- All Known Implementing Classes:
CitizenHappinessHandler
public interface ICitizenHappinessHandler
The citizen happiness handler interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddModifier(IHappinessModifier modifier) Add the modifier to the handler.doublegetHappiness(IColony colony, ICitizenData citizenData) Get the computed happiness of the citizen.getModifier(String name) Get a modifier by the name.Get a list of all modifiers.voidprocessDailyHappiness(ICitizenData citizenData) Process the happiness factors daily.voidread(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound, boolean persist) Read the handler from NBT.voidresetModifier(String name) Reset a modifier.voidwrite(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound, boolean persist) Write the handler to NBT.
-
Method Details
-
addModifier
Add the modifier to the handler.- Parameters:
modifier- the modifier.
-
resetModifier
Reset a modifier.- Parameters:
name- the name of the modifier.
-
getModifier
Get a modifier by the name.- Parameters:
name- the name of the modifier to return.- Returns:
- the modifier.
-
processDailyHappiness
Process the happiness factors daily.- Parameters:
citizenData- the citizen to process it for.
-
getHappiness
Get the computed happiness of the citizen.- Parameters:
colony- the colony.- Returns:
- the happiness.
-
read
void read(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound, boolean persist) Read the handler from NBT.- Parameters:
compound- the compound to read it from.persist- whether we're reading from persisted data or from networking.
-
write
void write(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound, boolean persist) Write the handler to NBT.- Parameters:
compound- the compound to write it to.persist- whether we're reading from persisted data or from networking.
-
getModifiers
Get a list of all modifiers.- Returns:
- the list.
-