Class StaticHappinessSupplier

java.lang.Object
com.minecolonies.api.entity.citizen.happiness.StaticHappinessSupplier
All Implemented Interfaces:
IHappinessSupplierWrapper, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class StaticHappinessSupplier extends Object implements IHappinessSupplierWrapper
Static Happiness supplier.
  • Constructor Details

    • StaticHappinessSupplier

      public StaticHappinessSupplier(double value)
      Create a new static supplier.
      Parameters:
      value - the static value to supply.
    • StaticHappinessSupplier

      public StaticHappinessSupplier()
      Default constructor for deserialization.
  • Method Details

    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider)
      Specified by:
      serializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      deserializeNBT in interface net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • getValue

      public double getValue(ICitizenData citizenData)
      Description copied from interface: IHappinessSupplierWrapper
      Get the matching value.
      Specified by:
      getValue in interface IHappinessSupplierWrapper
      Parameters:
      citizenData - the context.
      Returns:
      the value.
    • getLastCachedValue

      public double getLastCachedValue()
      Description copied from interface: IHappinessSupplierWrapper
      Get the last cache value in absence of the citizen.
      Specified by:
      getLastCachedValue in interface IHappinessSupplierWrapper
      Returns:
      the last cached value.