Class PressureEnchantingRecipe

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

public class PressureEnchantingRecipe extends PressureChamberRecipeImpl
  • Field Details

    • ID

      public static final net.minecraft.resources.ResourceLocation ID
  • Constructor Details

    • PressureEnchantingRecipe

      public PressureEnchantingRecipe(net.minecraft.resources.ResourceLocation id)
  • Method Details

    • findIngredients

      public Collection<Integer> findIngredients(@Nonnull net.minecraftforge.items.IItemHandler chamberHandler)
      Description copied from class: PressureChamberRecipe
      When called (by the pressure chamber BE when it detects a change in the chamber contents), try to find the ingredients for this recipe in the given item handler, which represents all the items currently in the pressure chamber. You must return a collection of slot indices into the item handler which contain the matching ingredients; those indices will be passed promptly to PressureChamberRecipe.getCraftingPressure(IItemHandler, List) and PressureChamberRecipe.craftRecipe(IItemHandler, List, boolean) by the pressure chamber.

      Do not cache this list across ticks, since the chamber contents are quite likely to change in the meantime.

      Overrides:
      findIngredients in class PressureChamberRecipeImpl
      Parameters:
      chamberHandler - what's currently in the pressure chamber
      Returns:
      if this recipe is valid, a list of slots in the item handler where the ingredients can be found; otherwise, an empty list
    • craftRecipe

      public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> craftRecipe(@Nonnull net.minecraftforge.items.IItemHandler chamberHandler, List<Integer> ingredientSlots, boolean simulate)
      Description copied from class: PressureChamberRecipe
      This method is called when the Pressure Chamber is ready to craft with this recipe, and will only be called when PressureChamberRecipe.findIngredients(IItemHandler) returns a non-empty list of slot numbers, i.e. the necessary items are definitely in the chamber. The implementation is responsible for removing the items that have been used from the chamberHandler. The implementation must also return the list of crafted items, for the Pressure Chamber to insert into its output item handler.
      Overrides:
      craftRecipe in class PressureChamberRecipeImpl
      Parameters:
      chamberHandler - items in the pressure chamber; should be modified to remove recipe input items.
      ingredientSlots - slots in the chamber handler where the ingredients can be found, as returned from PressureChamberRecipe.findIngredients(IItemHandler)
      simulate - pass on to uses of chamberHandler
      Returns:
      the resulting items; these do not have to be copies, since the Pressure Chamber itself will insert copies of these items
    • getInputsForDisplay

      public List<net.minecraft.world.item.crafting.Ingredient> getInputsForDisplay()
      Description copied from class: PressureChamberRecipe
      Get the input items for this recipe. This is primarily intended for recipe display purposes by JEI or any other recipe display mod.
      Overrides:
      getInputsForDisplay in class PressureChamberRecipeImpl
    • getSingleResultsForDisplay

      public List<net.minecraft.world.item.ItemStack> getSingleResultsForDisplay()
      Description copied from class: PressureChamberRecipe
      Implement if no output slots display more than one stack.
      Overrides:
      getSingleResultsForDisplay in class PressureChamberRecipeImpl
      See Also:
    • isValidInputItem

      public boolean isValidInputItem(net.minecraft.world.item.ItemStack stack)
      Description copied from class: PressureChamberRecipe
      Check if the given item is a valid input item for this recipe. This should also be true even if the number of items in the given item stack is smaller than the number required by the recipe; this is testing for item type, not item count.
      Overrides:
      isValidInputItem in class PressureChamberRecipeImpl
      Parameters:
      stack - item stack to check
      Returns:
      true if this is a valid item, false otherwise
    • getTooltipKey

      public String getTooltipKey(boolean input, String slotName)
      Description copied from class: PressureChamberRecipe
      Return a translation key for a supplementary tooltip to be displayed on the ingredient or resulting item. For use in recipe display systems such as JEI (PNC's JEI integration names slots as "in{N}" and "out{N}" where n >= 0)
      Overrides:
      getTooltipKey in class PressureChamberRecipe
      Parameters:
      input - true if this is an input item, false if an output item
      slotName - a unique slot name
      Returns:
      a tooltip translation key, or "" for no tooltip
    • write

      public void write(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from class: PneumaticCraftRecipe
      Writes this recipe to a PacketBuffer.
      Overrides:
      write in class PressureChamberRecipeImpl
      Parameters:
      buffer - The buffer to write to.
    • getSerializer

      public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>
      Overrides:
      getSerializer in class PressureChamberRecipeImpl