Class IngredientSerializerItemStack
java.lang.Object
org.cyclops.commoncapabilities.ingredient.IngredientSerializerItemStack
- All Implemented Interfaces:
IIngredientSerializer<net.minecraft.world.item.ItemStack,
Integer>
public class IngredientSerializerItemStack
extends Object
implements IIngredientSerializer<net.minecraft.world.item.ItemStack,Integer>
Serializer for ItemStacks.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserializeCondition
(net.minecraft.nbt.Tag tag) Deserialize a match condition from NBT.net.minecraft.world.item.ItemStack
deserializeInstance
(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.nbt.Tag tag) Deserialize an instance from NBT.net.minecraft.nbt.Tag
serializeCondition
(Integer matchCondition) Serialize a match condition to NBT.net.minecraft.nbt.Tag
serializeInstance
(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.world.item.ItemStack instance) Serialize an instance to NBT.
-
Constructor Details
-
IngredientSerializerItemStack
public IngredientSerializerItemStack()
-
-
Method Details
-
serializeInstance
public net.minecraft.nbt.Tag serializeInstance(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.world.item.ItemStack instance) Description copied from interface:IIngredientSerializer
Serialize an instance to NBT.- Specified by:
serializeInstance
in interfaceIIngredientSerializer<net.minecraft.world.item.ItemStack,
Integer> - Parameters:
lookupProvider
- The holder lookup provider.instance
- An instance.- Returns:
- An NBT tag.
-
deserializeInstance
public net.minecraft.world.item.ItemStack 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<net.minecraft.world.item.ItemStack,
Integer> - 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<net.minecraft.world.item.ItemStack,
Integer> - 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<net.minecraft.world.item.ItemStack,
Integer> - 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.
-