Package appeng.api.crafting
Class PatternDetailsHelper
java.lang.Object
appeng.api.crafting.PatternDetailsHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable IPatternDetailsdecodePattern(AEItemKey what, net.minecraft.world.level.Level level) static @Nullable IPatternDetailsdecodePattern(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) static @Nullable IPatternDetailsdecodePattern(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level, boolean autoRecovery) static net.minecraft.world.item.ItemStackencodeCraftingPattern(net.minecraft.world.item.crafting.CraftingRecipe recipe, net.minecraft.world.item.ItemStack[] in, net.minecraft.world.item.ItemStack out, boolean allowSubstitutes, boolean allowFluidSubstitutes) Encodes a crafting pattern which represents a Vanilla crafting recipe.static net.minecraft.world.item.ItemStackencodeProcessingPattern(GenericStack[] in, GenericStack[] out) Encodes a processing pattern which represents the ability to convert the given inputs into the given outputs using some process external to the ME system.static net.minecraft.world.item.ItemStackencodeSmithingTablePattern(net.minecraft.world.item.crafting.SmithingRecipe recipe, AEItemKey template, AEItemKey base, AEItemKey addition, AEItemKey out, boolean allowSubstitutes) Encodes a smithing table pattern which represents a Vanilla Smithing Table recipe.static net.minecraft.world.item.ItemStackencodeStonecuttingPattern(net.minecraft.world.item.crafting.StonecutterRecipe recipe, AEItemKey in, AEItemKey out, boolean allowSubstitutes) Encodes a stonecutting pattern which represents a Vanilla Stonecutter recipe.static booleanisEncodedPattern(net.minecraft.world.item.ItemStack stack) static voidregisterDecoder(IPatternDetailsDecoder decoder)
-
Constructor Details
-
PatternDetailsHelper
public PatternDetailsHelper()
-
-
Method Details
-
registerDecoder
-
isEncodedPattern
public static boolean isEncodedPattern(net.minecraft.world.item.ItemStack stack) -
decodePattern
@Nullable public static @Nullable IPatternDetails decodePattern(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) -
decodePattern
@Nullable public static @Nullable IPatternDetails decodePattern(AEItemKey what, net.minecraft.world.level.Level level) -
decodePattern
@Nullable public static @Nullable IPatternDetails decodePattern(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level, boolean autoRecovery) -
encodeProcessingPattern
public static net.minecraft.world.item.ItemStack encodeProcessingPattern(GenericStack[] in, GenericStack[] out) Encodes a processing pattern which represents the ability to convert the given inputs into the given outputs using some process external to the ME system.- Parameters:
out- The first element is considered the primary output and must be present- Returns:
- A new encoded pattern.
- Throws:
IllegalArgumentException- If either in or out contain only empty ItemStacks, or no primary output
-
encodeCraftingPattern
public static net.minecraft.world.item.ItemStack encodeCraftingPattern(net.minecraft.world.item.crafting.CraftingRecipe recipe, net.minecraft.world.item.ItemStack[] in, net.minecraft.world.item.ItemStack out, boolean allowSubstitutes, boolean allowFluidSubstitutes) Encodes a crafting pattern which represents a Vanilla crafting recipe.- Parameters:
recipe- The Vanilla crafting recipe to be encoded.in- The items in the crafting grid, which are used to determine what items are supplied from the ME system to craft using this pattern.out- What is to be expected as the result of this crafting operation by the ME system.allowSubstitutes- Controls whether the ME system will allow the use of equivalent items to craft this recipe.allowFluidSubstitutes- Controls whether the ME system will allow the use of equivalent fluids.- Throws:
IllegalArgumentException- If either in or out contain only empty ItemStacks.
-
encodeStonecuttingPattern
public static net.minecraft.world.item.ItemStack encodeStonecuttingPattern(net.minecraft.world.item.crafting.StonecutterRecipe recipe, AEItemKey in, AEItemKey out, boolean allowSubstitutes) Encodes a stonecutting pattern which represents a Vanilla Stonecutter recipe.- Parameters:
recipe- The Vanilla stonecutter recipe to be encoded.in- The input item for the stonecutter, which is used to determine which item is supplied from the ME system to craft using this pattern.out- The selected output item from the stonecutter recipe. Used to restore the recipe if it is renamed later.allowSubstitutes- Controls whether the ME system will allow the use of equivalent items to craft this recipe.
-
encodeSmithingTablePattern
public static net.minecraft.world.item.ItemStack encodeSmithingTablePattern(net.minecraft.world.item.crafting.SmithingRecipe recipe, AEItemKey template, AEItemKey base, AEItemKey addition, AEItemKey out, boolean allowSubstitutes) Encodes a smithing table pattern which represents a Vanilla Smithing Table recipe.- Parameters:
recipe- The Vanilla smithing table recipe to be encoded.template- The template item for the smithing table.base- The base item for the smithing table, which is used to determine which item is supplied from the ME system to craft using this pattern.addition- The additional item for the smithing table, which is used to determine which item is supplied from the ME system to craft using this pattern.out- The selected output item from the smithing table recipe. Used to restore the recipe if it is renamed later.allowSubstitutes- Controls whether the ME system will allow the use of equivalent items to craft this recipe.
-