Class DifferenceIngredient
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.DifferenceIngredient
- All Implemented Interfaces:
io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient,Predicate<net.minecraft.world.item.ItemStack>
Ingredient that matches everything from the first ingredient that is not included in the second ingredient
-
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
ConstructorsModifierConstructorDescriptionprotectedDifferenceIngredient(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted) -
Method Summary
Modifier and TypeMethodDescriptionio.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializernet.minecraft.world.item.ItemStack[]getItems()it.unimi.dsi.fastutil.ints.IntListbooleanisEmpty()static DifferenceIngredientof(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted) Gets the difference from the two ingredientsbooleantest(@Nullable net.minecraft.world.item.ItemStack stack) 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
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
-
DifferenceIngredient
protected DifferenceIngredient(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted)
-
-
Method Details
-
of
public static DifferenceIngredient of(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted) Gets the difference from the two ingredients- Parameters:
base- Ingredient the item must matchsubtracted- Ingredient the item must not match- Returns:
- Ingredient that
baseanything in base that is not insubtracted
-
test
public boolean test(@Nullable @Nullable net.minecraft.world.item.ItemStack stack) -
getItems
public net.minecraft.world.item.ItemStack[] getItems()- Overrides:
getItemsin classnet.minecraft.world.item.crafting.Ingredient
-
isEmpty
public boolean isEmpty()- Overrides:
isEmptyin classnet.minecraft.world.item.crafting.Ingredient
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds()- Overrides:
getStackingIdsin classnet.minecraft.world.item.crafting.Ingredient
-
toJson
public com.google.gson.JsonElement toJson()- Specified by:
toJsonin classAbstractIngredient
-
getDeserializer
public io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer getDeserializer() -
toNetwork
public void toNetwork(net.minecraft.network.FriendlyByteBuf buffer) - Overrides:
toNetworkin classnet.minecraft.world.item.crafting.Ingredient
-