Class DynamicHappinessSupplier

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

public class DynamicHappinessSupplier extends Object implements IHappinessSupplierWrapper
Dynamic Happiness supplier.
  • Constructor Details

    • DynamicHappinessSupplier

      public DynamicHappinessSupplier(net.minecraft.resources.ResourceLocation key)
      Create a new dynamic supplier.
      Parameters:
      key - the key of the function.
    • DynamicHappinessSupplier

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

    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
      Specified by:
      serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
    • deserializeNBT

      public void deserializeNBT(net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      deserializeNBT in interface net.minecraftforge.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.