Class StaticHappinessSupplier
java.lang.Object
com.minecolonies.api.entity.citizen.happiness.StaticHappinessSupplier
- All Implemented Interfaces:
IHappinessSupplierWrapper,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Static Happiness supplier.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.StaticHappinessSupplier(double value) Create a new static supplier. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserializeNBT(net.minecraft.nbt.CompoundTag nbt) doubleGet the last cache value in absence of the citizen.doublegetValue(ICitizenData citizenData) Get the matching value.net.minecraft.nbt.CompoundTag
-
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()- Specified by:
serializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag nbt) - Specified by:
deserializeNBTin interfacenet.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
getValue
Description copied from interface:IHappinessSupplierWrapperGet the matching value.- Specified by:
getValuein interfaceIHappinessSupplierWrapper- Parameters:
citizenData- the context.- Returns:
- the value.
-
getLastCachedValue
public double getLastCachedValue()Description copied from interface:IHappinessSupplierWrapperGet the last cache value in absence of the citizen.- Specified by:
getLastCachedValuein interfaceIHappinessSupplierWrapper- Returns:
- the last cached value.
-