java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.target.MergeOption

public class MergeOption extends Object
  • Constructor Details

    • MergeOption

      protected MergeOption()
    • MergeOption

      public MergeOption(int[] slots, MergeAdapter... adapters)
    • MergeOption

      public MergeOption(MergeOption mergeOption)
  • Method Details

    • merge

      public org.bukkit.inventory.ItemStack merge(RecipeData<?> recipeData, @Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.block.Block block, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
      Merges the nbt of recipes onto the resulting ItemStack using the specified MergeAdapters. The order in which the adapters are called is the same order as they were added.
      Parameters:
      recipeData - The RecipeData, that contains all the data of the pre-crafted recipe, like ingredients and their slots, result, and the recipe itself.
      player - The player that has crafted the item. Might be null! e.g. Furnaces, and other workstations without player interaction!
      block - The block that has processed the recipe. Might be null! e.g. 2x2 player crafting grid, inventories with an associated block, etc.!
      customResult - The CustomItem of the crafted item.
      result - The actual manipulable result ItemStack. Previous adapters might have already manipulated this item!
      Returns:
      The final manipulated resulting ItemStack of this option, that will be passed to the next option if one is available.
    • getSlots

      public int[] getSlots()
    • setSlots

      public void setSlots(int[] slots)
    • setAdapters

      public void setAdapters(List<MergeAdapter> adapters)
    • clone

      public MergeOption clone()
      Overrides:
      clone in class Object