Class IngredientSerializerEnergy
java.lang.Object
org.cyclops.commoncapabilities.ingredient.IngredientSerializerEnergy
- All Implemented Interfaces:
IIngredientSerializer<Long,Boolean>
public class IngredientSerializerEnergy
extends Object
implements IIngredientSerializer<Long,Boolean>
Serializer for energy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserializeCondition(net.minecraft.nbt.Tag tag) Deserialize a match condition from NBT.deserializeInstance(net.minecraft.world.level.storage.ValueInput valueInput) Deserialize an instance from NBT.net.minecraft.nbt.TagserializeCondition(Boolean matchCondition) Serialize a match condition to NBT.voidserializeInstance(net.minecraft.world.level.storage.ValueOutput valueOutput, Long instance) Serialize an instance to NBT.
-
Constructor Details
-
IngredientSerializerEnergy
public IngredientSerializerEnergy()
-
-
Method Details
-
serializeInstance
public void serializeInstance(net.minecraft.world.level.storage.ValueOutput valueOutput, Long instance) Description copied from interface:IIngredientSerializerSerialize an instance to NBT.- Specified by:
serializeInstancein interfaceIIngredientSerializer<Long,Boolean> - Parameters:
valueOutput- The value output.instance- An instance.
-
deserializeInstance
public Long deserializeInstance(net.minecraft.world.level.storage.ValueInput valueInput) throws IllegalArgumentException Description copied from interface:IIngredientSerializerDeserialize an instance from NBT.- Specified by:
deserializeInstancein interfaceIIngredientSerializer<Long,Boolean> - Parameters:
valueInput- The value input.- Returns:
- An instance.
- Throws:
IllegalArgumentException- If the given tag is invalid or does not contain data on the given instance.
-
serializeCondition
Description copied from interface:IIngredientSerializerSerialize a match condition to NBT.- Specified by:
serializeConditionin interfaceIIngredientSerializer<Long,Boolean> - Parameters:
matchCondition- A match condition.- Returns:
- An NBT tag.
-
deserializeCondition
Description copied from interface:IIngredientSerializerDeserialize a match condition from NBT.- Specified by:
deserializeConditionin interfaceIIngredientSerializer<Long,Boolean> - Parameters:
tag- An NBT tag.- Returns:
- A match condition.
- Throws:
IllegalArgumentException- If the given tag is invalid or does not contain data on the given match condition.
-