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
-
Method Summary
Modifier and TypeMethodDescriptiondeserializeCondition
(net.minecraft.nbt.Tag tag) Deserialize a match condition from NBT.deserializeInstance
(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.nbt.Tag tag) Deserialize an instance from NBT.net.minecraft.nbt.Tag
serializeCondition
(Boolean matchCondition) Serialize a match condition to NBT.net.minecraft.nbt.Tag
serializeInstance
(net.minecraft.core.HolderLookup.Provider lookupProvider, Long instance) Serialize an instance to NBT.
-
Constructor Details
-
IngredientSerializerEnergy
public IngredientSerializerEnergy()
-
-
Method Details
-
serializeInstance
public net.minecraft.nbt.Tag serializeInstance(net.minecraft.core.HolderLookup.Provider lookupProvider, Long instance) Description copied from interface:IIngredientSerializer
Serialize an instance to NBT.- Specified by:
serializeInstance
in interfaceIIngredientSerializer<Long,
Boolean> - Parameters:
lookupProvider
- The holder lookup provider.instance
- An instance.- Returns:
- An NBT tag.
-
deserializeInstance
public Long deserializeInstance(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.nbt.Tag tag) throws IllegalArgumentException Description copied from interface:IIngredientSerializer
Deserialize an instance from NBT.- Specified by:
deserializeInstance
in interfaceIIngredientSerializer<Long,
Boolean> - Parameters:
lookupProvider
- The holder lookup provider.tag
- An NBT tag.- 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:IIngredientSerializer
Serialize a match condition to NBT.- Specified by:
serializeCondition
in interfaceIIngredientSerializer<Long,
Boolean> - Parameters:
matchCondition
- A match condition.- Returns:
- An NBT tag.
-
deserializeCondition
Description copied from interface:IIngredientSerializer
Deserialize a match condition from NBT.- Specified by:
deserializeCondition
in 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.
-