Package net.minecraft.recipe
Class RecipeMatcher
java.lang.Object
net.minecraft.recipe.RecipeMatcher
Matching class that matches a recipe to its required resources.
This specifically does not check patterns (See
ShapedRecipe for that).- Mappings:
Namespace Name official bwtintermediary net/minecraft/class_1662named net/minecraft/recipe/RecipeMatcher
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intfinal it.unimi.dsi.fastutil.ints.Int2IntMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddInput(int itemId, int count) Adds an input to be used for recipe matching.voidAdds a full item stack to the pool of available resources.voidAdds an item stack to the pool of available resources.voidaddUnenchantedInput(ItemStack stack) Adds a full item stack to the pool of available resources.voidclear()(package private) intconsume(int itemId, int count) Consumes a resource from the pool of available items.(package private) booleancontains(int itemId) Determines whether a raw item id is present in the pool of crafting resources.intcountCrafts(Recipe<?> recipe, int limit, @Nullable it.unimi.dsi.fastutil.ints.IntList output) Determines the number of crafts that can be produced for a recipe using the collected resources available to this crafter.intcountCrafts(Recipe<?> recipe, @Nullable it.unimi.dsi.fastutil.ints.IntList output) Determines the number of crafts that can be produced for a recipe using the collected resources available to this crafter.static intstatic ItemStackgetStackFromId(int itemId) booleanAttempts to match the recipe against the collected inputs.booleanAttempts to match the recipe against the collected inputs.
-
Field Details
-
field_30653
private static final int field_30653- See Also:
- Mappings:
Namespace Name Mixin selector official bLbwt;b:Iintermediary field_30653Lnet/minecraft/class_1662;field_30653:Inamed field_30653Lnet/minecraft/recipe/RecipeMatcher;field_30653:I
-
inputs
public final it.unimi.dsi.fastutil.ints.Int2IntMap inputs- Mappings:
Namespace Name Mixin selector official aLbwt;a:Lit/unimi/dsi/fastutil/ints/Int2IntMap;intermediary field_7550Lnet/minecraft/class_1662;field_7550:Lit/unimi/dsi/fastutil/ints/Int2IntMap;named inputsLnet/minecraft/recipe/RecipeMatcher;inputs:Lit/unimi/dsi/fastutil/ints/Int2IntMap;
-
-
Constructor Details
-
RecipeMatcher
public RecipeMatcher()
-
-
Method Details
-
addUnenchantedInput
Adds a full item stack to the pool of available resources.This is equivalent to calling
addInput(stack, Item.DEFAULT_MAX_COUNT).- Mappings:
Namespace Name Mixin selector official aLbwt;a(Lcdt;)Vintermediary method_7404Lnet/minecraft/class_1662;method_7404(Lnet/minecraft/class_1799;)Vnamed addUnenchantedInputLnet/minecraft/recipe/RecipeMatcher;addUnenchantedInput(Lnet/minecraft/item/ItemStack;)V
-
addInput
Adds a full item stack to the pool of available resources.This is equivalent to calling
addInput(stack, Item.DEFAULT_MAX_COUNT).- Mappings:
Namespace Name Mixin selector official bLbwt;b(Lcdt;)Vintermediary method_7400Lnet/minecraft/class_1662;method_7400(Lnet/minecraft/class_1799;)Vnamed addInputLnet/minecraft/recipe/RecipeMatcher;addInput(Lnet/minecraft/item/ItemStack;)V
-
addInput
Adds an item stack to the pool of available resources.- Mappings:
Namespace Name Mixin selector official aLbwt;a(Lcdt;I)Vintermediary method_20478Lnet/minecraft/class_1662;method_20478(Lnet/minecraft/class_1799;I)Vnamed addInputLnet/minecraft/recipe/RecipeMatcher;addInput(Lnet/minecraft/item/ItemStack;I)V
-
getItemId
- Mappings:
Namespace Name Mixin selector official cLbwt;c(Lcdt;)Iintermediary method_7408Lnet/minecraft/class_1662;method_7408(Lnet/minecraft/class_1799;)Inamed getItemIdLnet/minecraft/recipe/RecipeMatcher;getItemId(Lnet/minecraft/item/ItemStack;)I
-
contains
boolean contains(int itemId) Determines whether a raw item id is present in the pool of crafting resources.- Mappings:
Namespace Name Mixin selector official bLbwt;b(I)Zintermediary method_7410Lnet/minecraft/class_1662;method_7410(I)Znamed containsLnet/minecraft/recipe/RecipeMatcher;contains(I)Z
-
consume
int consume(int itemId, int count) Consumes a resource from the pool of available items.- Parameters:
itemId- the raw id of the item being consumedcount- the number of times that item must be consumed- Mappings:
Namespace Name Mixin selector official aLbwt;a(II)Iintermediary method_7411Lnet/minecraft/class_1662;method_7411(II)Inamed consumeLnet/minecraft/recipe/RecipeMatcher;consume(II)I
-
addInput
void addInput(int itemId, int count) Adds an input to be used for recipe matching.- Parameters:
itemId- the raw ID of the item to matchcount- the item's count- Mappings:
Namespace Name Mixin selector official bLbwt;b(II)Vintermediary method_7401Lnet/minecraft/class_1662;method_7401(II)Vnamed addInputLnet/minecraft/recipe/RecipeMatcher;addInput(II)V
-
match
public boolean match(Recipe<?> recipe, @Nullable @Nullable it.unimi.dsi.fastutil.ints.IntList output) Attempts to match the recipe against the collected inputs. Assumes only one output is required.- Parameters:
recipe- the recipe to match againstoutput- optional output list of item ids that were matched whilst evaluating the recipe conditions- Mappings:
Namespace Name Mixin selector official aLbwt;a(Lcgo;Lit/unimi/dsi/fastutil/ints/IntList;)Zintermediary method_7402Lnet/minecraft/class_1662;method_7402(Lnet/minecraft/class_1860;Lit/unimi/dsi/fastutil/ints/IntList;)Znamed matchLnet/minecraft/recipe/RecipeMatcher;match(Lnet/minecraft/recipe/Recipe;Lit/unimi/dsi/fastutil/ints/IntList;)Z
-
match
public boolean match(Recipe<?> recipe, @Nullable @Nullable it.unimi.dsi.fastutil.ints.IntList output, int multiplier) Attempts to match the recipe against the collected inputs. Will only succeed if there has been enough resources gathered to produce the requested number of outputs.- Parameters:
recipe- the recipe to match againstoutput- optional output list of item ids that were matched whilst evaluating the recipe conditionsmultiplier- the number of expected outputs- Mappings:
Namespace Name Mixin selector official aLbwt;a(Lcgo;Lit/unimi/dsi/fastutil/ints/IntList;I)Zintermediary method_7406Lnet/minecraft/class_1662;method_7406(Lnet/minecraft/class_1860;Lit/unimi/dsi/fastutil/ints/IntList;I)Znamed matchLnet/minecraft/recipe/RecipeMatcher;match(Lnet/minecraft/recipe/Recipe;Lit/unimi/dsi/fastutil/ints/IntList;I)Z
-
countCrafts
public int countCrafts(Recipe<?> recipe, @Nullable @Nullable it.unimi.dsi.fastutil.ints.IntList output) Determines the number of crafts that can be produced for a recipe using the collected resources available to this crafter.- Parameters:
recipe- the recipe to match againstoutput- optional output list of item ids that were matched whilst evaluating the recipe conditions- Mappings:
Namespace Name Mixin selector official bLbwt;b(Lcgo;Lit/unimi/dsi/fastutil/ints/IntList;)Iintermediary method_7407Lnet/minecraft/class_1662;method_7407(Lnet/minecraft/class_1860;Lit/unimi/dsi/fastutil/ints/IntList;)Inamed countCraftsLnet/minecraft/recipe/RecipeMatcher;countCrafts(Lnet/minecraft/recipe/Recipe;Lit/unimi/dsi/fastutil/ints/IntList;)I
-
countCrafts
public int countCrafts(Recipe<?> recipe, int limit, @Nullable @Nullable it.unimi.dsi.fastutil.ints.IntList output) Determines the number of crafts that can be produced for a recipe using the collected resources available to this crafter.- Parameters:
recipe- the recipe to match againstoutput- optional output list of item ids that were matched whilst evaluating the recipe conditions- Mappings:
Namespace Name Mixin selector official aLbwt;a(Lcgo;ILit/unimi/dsi/fastutil/ints/IntList;)Iintermediary method_7403Lnet/minecraft/class_1662;method_7403(Lnet/minecraft/class_1860;ILit/unimi/dsi/fastutil/ints/IntList;)Inamed countCraftsLnet/minecraft/recipe/RecipeMatcher;countCrafts(Lnet/minecraft/recipe/Recipe;ILit/unimi/dsi/fastutil/ints/IntList;)I
-
getStackFromId
- Mappings:
Namespace Name Mixin selector official aLbwt;a(I)Lcdt;intermediary method_7405Lnet/minecraft/class_1662;method_7405(I)Lnet/minecraft/class_1799;named getStackFromIdLnet/minecraft/recipe/RecipeMatcher;getStackFromId(I)Lnet/minecraft/item/ItemStack;
-
clear
public void clear()- Mappings:
Namespace Name Mixin selector official aLbwt;a()Vintermediary method_7409Lnet/minecraft/class_1662;method_7409()Vnamed clearLnet/minecraft/recipe/RecipeMatcher;clear()V
-