Class TimeBasedHappinessModifier

java.lang.Object
com.minecolonies.api.entity.citizen.happiness.AbstractHappinessModifier
com.minecolonies.api.entity.citizen.happiness.TimeBasedHappinessModifier
All Implemented Interfaces:
IHappinessModifier, ITimeBasedHappinessModifier

public final class TimeBasedHappinessModifier extends AbstractHappinessModifier implements ITimeBasedHappinessModifier
The time based happiness modifier. Over a time the buff/boost gets worse.
  • Constructor Details

    • TimeBasedHappinessModifier

      @SafeVarargs public TimeBasedHappinessModifier(String id, double weight, IHappinessSupplierWrapper supplier, Tuple<Integer,Double>... timeBasedFactor)
      Create an instance of the happiness modifier.
      Parameters:
      id - its string id.
      weight - its weight.
      supplier - the supplier to get the factor.
      timeBasedFactor - tuples about the boost/buff factor over time.
    • TimeBasedHappinessModifier

      @SafeVarargs public TimeBasedHappinessModifier(String id, double weight, IHappinessSupplierWrapper supplier, BiPredicate<TimeBasedHappinessModifier,ICitizenData> dayRollOverPredicate, Tuple<Integer,Double>... timeBasedFactor)
      Create an instance of the happiness modifier.
      Parameters:
      id - its string id.
      weight - its weight.
      supplier - the supplier to get the factor.
      dayRollOverPredicate - a predicate to check whether the current day should roll over or reset.
      timeBasedFactor - tuples about the boost/buff factor over time.
    • TimeBasedHappinessModifier

      public TimeBasedHappinessModifier()
      Create an instance of the happiness modifier.
  • Method Details