Interface ICitizenHappinessHandler

All Known Implementing Classes:
CitizenHappinessHandler

public interface ICitizenHappinessHandler
The citizen happiness handler interface.
  • Method Details

    • addModifier

      void addModifier(IHappinessModifier modifier)
      Add the modifier to the handler.
      Parameters:
      modifier - the modifier.
    • resetModifier

      void resetModifier(String name)
      Reset a modifier.
      Parameters:
      name - the name of the modifier.
    • getModifier

      IHappinessModifier getModifier(String name)
      Get a modifier by the name.
      Parameters:
      name - the name of the modifier to return.
      Returns:
      the modifier.
    • processDailyHappiness

      void processDailyHappiness(ICitizenData citizenData)
      Process the happiness factors daily.
      Parameters:
      citizenData - the citizen to process it for.
    • getHappiness

      double getHappiness(IColony colony, ICitizenData citizenData)
      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

      List<String> getModifiers()
      Get a list of all modifiers.
      Returns:
      the list.