Class PartialNBTIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
io.github.tropheusj.serialization_hooks.ingredient.BaseCustomIngredient
io.github.vampirestudios.vampirelib.crafting.AbstractIngredient
io.github.vampirestudios.vampirelib.crafting.PartialNBTIngredient
- All Implemented Interfaces:
io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient,Predicate<net.minecraft.world.item.ItemStack>
Ingredient that matches the given items, performing a partial NBT match. Use
NBTIngredient if you want exact match on NBT-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
net.minecraft.world.item.crafting.Ingredient.ItemValue, net.minecraft.world.item.crafting.Ingredient.TagValue, net.minecraft.world.item.crafting.Ingredient.Value -
Field Summary
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, values -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPartialNBTIngredient(Set<net.minecraft.world.item.Item> items, net.minecraft.nbt.CompoundTag nbt) -
Method Summary
Modifier and TypeMethodDescriptionio.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializerstatic PartialNBTIngredientof(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.ItemLike... items) Creates a new ingredient matching any item from the list, containing the given NBTstatic PartialNBTIngredientof(net.minecraft.world.level.ItemLike item, net.minecraft.nbt.CompoundTag nbt) Creates a new ingredient matching the given item, containing the given NBTbooleantest(@Nullable net.minecraft.world.item.ItemStack input) com.google.gson.JsonElementtoJson()voidtoNetwork(net.minecraft.network.FriendlyByteBuf buffer) Methods inherited from class io.github.vampirestudios.vampirelib.crafting.AbstractIngredient
fromJson, fromNetwork, fromValues, of, of, of, of, ofMethods inherited from class net.minecraft.world.item.crafting.Ingredient
getItems, getStackingIds, isEmpty, valueFromJsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient
customDeserializer, customTest, testCustom
-
Constructor Details
-
PartialNBTIngredient
protected PartialNBTIngredient(Set<net.minecraft.world.item.Item> items, net.minecraft.nbt.CompoundTag nbt)
-
-
Method Details
-
of
public static PartialNBTIngredient of(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.ItemLike... items) Creates a new ingredient matching any item from the list, containing the given NBT -
of
public static PartialNBTIngredient of(net.minecraft.world.level.ItemLike item, net.minecraft.nbt.CompoundTag nbt) Creates a new ingredient matching the given item, containing the given NBT -
test
public boolean test(@Nullable @Nullable net.minecraft.world.item.ItemStack input) -
getDeserializer
public io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer getDeserializer() -
toJson
public com.google.gson.JsonElement toJson()- Specified by:
toJsonin classAbstractIngredient
-
toNetwork
public void toNetwork(net.minecraft.network.FriendlyByteBuf buffer) - Overrides:
toNetworkin classnet.minecraft.world.item.crafting.Ingredient
-