Class AssemblyRecipeImpl
java.lang.Object
me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
me.desht.pneumaticcraft.api.crafting.recipe.AssemblyRecipe
me.desht.pneumaticcraft.common.recipes.machine.AssemblyRecipeImpl
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAssemblyRecipeImpl.Serializer<T extends AssemblyRecipe>Nested classes/interfaces inherited from class me.desht.pneumaticcraft.api.crafting.recipe.AssemblyRecipe
AssemblyRecipe.AssemblyProgramTypeNested classes/interfaces inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
PneumaticCraftRecipe.DummyIInventory -
Constructor Summary
ConstructorsConstructorDescriptionAssemblyRecipeImpl(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient input, net.minecraft.world.item.ItemStack output, AssemblyRecipe.AssemblyProgramType program) -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<net.minecraft.resources.ResourceLocation,AssemblyRecipe> calculateAssemblyChain(Collection<AssemblyRecipe> drillRecipes, Collection<AssemblyRecipe> laserRecipes) Work out which recipes can be chained.net.minecraft.world.item.crafting.IngredientgetInput()Get the input ingredient.intGet the number of items required/usednet.minecraft.world.item.ItemStackGet the output item for this recipe.Get the program required.net.minecraft.world.item.crafting.RecipeSerializer<?>net.minecraft.world.item.crafting.RecipeType<?>getType()booleanmatches(net.minecraft.world.item.ItemStack stack) Check if the given stack is a valid input for this recipe.voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes this recipe to a PacketBuffer.Methods inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
assemble, canCraftInDimensions, getId, getResultItem, isSpecial, matchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getGroup, getIngredients, getRemainingItems, getToastSymbol, isIncomplete
-
Constructor Details
-
AssemblyRecipeImpl
public AssemblyRecipeImpl(net.minecraft.resources.ResourceLocation id, @Nonnull net.minecraft.world.item.crafting.Ingredient input, @Nonnull net.minecraft.world.item.ItemStack output, AssemblyRecipe.AssemblyProgramType program)
-
-
Method Details
-
getInput
public net.minecraft.world.item.crafting.Ingredient getInput()Description copied from class:AssemblyRecipeGet the input ingredient.- Specified by:
getInputin classAssemblyRecipe- Returns:
- the input ingredient
-
getInputAmount
public int getInputAmount()Description copied from class:AssemblyRecipeGet the number of items required/used- Specified by:
getInputAmountin classAssemblyRecipe- Returns:
- the number of items
-
getOutput
public net.minecraft.world.item.ItemStack getOutput()Description copied from class:AssemblyRecipeGet the output item for this recipe.- Specified by:
getOutputin classAssemblyRecipe- Returns:
- the output item
-
getProgramType
Description copied from class:AssemblyRecipeGet the program required.- Specified by:
getProgramTypein classAssemblyRecipe- Returns:
- the program type
-
matches
public boolean matches(net.minecraft.world.item.ItemStack stack) Description copied from class:AssemblyRecipeCheck if the given stack is a valid input for this recipe.- Specified by:
matchesin classAssemblyRecipe- Parameters:
stack- input stack- Returns:
- true if valid, false otherwise
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) Description copied from class:PneumaticCraftRecipeWrites this recipe to a PacketBuffer.- Specified by:
writein classPneumaticCraftRecipe- Parameters:
buffer- The buffer to write to.
-
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer() -
getType
public net.minecraft.world.item.crafting.RecipeType<?> getType() -
calculateAssemblyChain
public static Map<net.minecraft.resources.ResourceLocation,AssemblyRecipe> calculateAssemblyChain(Collection<AssemblyRecipe> drillRecipes, Collection<AssemblyRecipe> laserRecipes) Work out which recipes can be chained. E.g. if laser recipe makes B from A, and drill recipe makes C from B, then add a synthetic laser/drill recipe to make C from A. Takes into account the number of inputs and outputs from each step.- Parameters:
drillRecipes- all known drill recipeslaserRecipes- all known laser recipes- Returns:
- a map (recipeId -> recipe) of all synthetic laser/drill recipes
-