Class AssemblyRecipeImpl

All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>

public class AssemblyRecipeImpl extends AssemblyRecipe
  • 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: AssemblyRecipe
      Get the input ingredient.
      Specified by:
      getInput in class AssemblyRecipe
      Returns:
      the input ingredient
    • getInputAmount

      public int getInputAmount()
      Description copied from class: AssemblyRecipe
      Get the number of items required/used
      Specified by:
      getInputAmount in class AssemblyRecipe
      Returns:
      the number of items
    • getOutput

      public net.minecraft.world.item.ItemStack getOutput()
      Description copied from class: AssemblyRecipe
      Get the output item for this recipe.
      Specified by:
      getOutput in class AssemblyRecipe
      Returns:
      the output item
    • getProgramType

      public AssemblyRecipe.AssemblyProgramType getProgramType()
      Description copied from class: AssemblyRecipe
      Get the program required.
      Specified by:
      getProgramType in class AssemblyRecipe
      Returns:
      the program type
    • matches

      public boolean matches(net.minecraft.world.item.ItemStack stack)
      Description copied from class: AssemblyRecipe
      Check if the given stack is a valid input for this recipe.
      Specified by:
      matches in class AssemblyRecipe
      Parameters:
      stack - input stack
      Returns:
      true if valid, false otherwise
    • write

      public void write(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from class: PneumaticCraftRecipe
      Writes this recipe to a PacketBuffer.
      Specified by:
      write in class PneumaticCraftRecipe
      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 recipes
      laserRecipes - all known laser recipes
      Returns:
      a map (recipeId -> recipe) of all synthetic laser/drill recipes