Class ExplosionCraftingRecipeImpl

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

public class ExplosionCraftingRecipeImpl extends ExplosionCraftingRecipe
  • Constructor Details

    • ExplosionCraftingRecipeImpl

      public ExplosionCraftingRecipeImpl(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient input, int lossRate, net.minecraft.world.item.ItemStack... outputs)
  • Method Details

    • getInput

      public net.minecraft.world.item.crafting.Ingredient getInput()
      Description copied from class: ExplosionCraftingRecipe
      Get the input ingredient for this recipe.
      Specified by:
      getInput in class ExplosionCraftingRecipe
      Returns:
      the input ingredient
    • getAmount

      public int getAmount()
      Description copied from class: ExplosionCraftingRecipe
      Get the number of items which will be taken from the input to create the output item.

      This should be the number of items in any itemstack returned from getInput().getMatchedStacks(); for basic Ingredient ingredients, this will always be 1, but custom ingredient subclasses could return a large number.

      Specified by:
      getAmount in class ExplosionCraftingRecipe
      Returns:
      the number of items
    • getOutputs

      public List<net.minecraft.world.item.ItemStack> getOutputs()
      Description copied from class: ExplosionCraftingRecipe
      Get a list of the output item(s).
      Specified by:
      getOutputs in class ExplosionCraftingRecipe
      Returns:
      the outputs
    • getLossRate

      public int getLossRate()
      Description copied from class: ExplosionCraftingRecipe
      Get the recipe loss rate, as a percentage.
      Specified by:
      getLossRate in class ExplosionCraftingRecipe
      Returns:
      the loss rate
    • matches

      public boolean matches(net.minecraft.world.item.ItemStack stack)
      Description copied from class: ExplosionCraftingRecipe
      Check if the given itemstack matches this recipe. The stack's item should match, and additionally there should be at least ExplosionCraftingRecipe.getAmount() items in the stack.
      Specified by:
      matches in class ExplosionCraftingRecipe
      Parameters:
      stack - the itemstack to check
      Returns:
      true if this itemstack matches this recipe, false otherwise
    • tryToCraft

      public static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> tryToCraft(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack)
    • 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()
    • getGroup

      public String getGroup()
    • getToastSymbol

      public net.minecraft.world.item.ItemStack getToastSymbol()