java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.target.MergeAdapter
All Implemented Interfaces:
me.wolfyscript.utilities.util.Keyed
Direct Known Subclasses:
DamageMergeAdapter, EnchantedBookMergeAdapter, EnchantMergeAdapter, PlaceholderAPIMergeAdapter

public abstract class MergeAdapter extends Object implements me.wolfyscript.utilities.util.Keyed
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected me.wolfyscript.utilities.util.NamespacedKey
     
    protected int[]
    These are the slots selected by the merge option.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    MergeAdapter​(me.wolfyscript.utilities.util.NamespacedKey key)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract MergeAdapter
     
    me.wolfyscript.utilities.util.NamespacedKey
     
    abstract org.bukkit.inventory.ItemStack
    merge​(RecipeData<?> recipeData, @Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.block.Block block, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
    Called when the data is merged inside of recipes like Furnace, Smithing Table, etc.
    org.bukkit.inventory.ItemStack
    merge​(org.bukkit.inventory.ItemStack[] ingredients, @Nullable org.bukkit.entity.Player player, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
    Deprecated.
    org.bukkit.inventory.ItemStack
    mergeCrafting​(CraftingData craftingData, org.bukkit.entity.Player player, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
    Deprecated.
    Replaced with merge(RecipeData, Player, Block, CustomItem, ItemStack)! All recipe types call that one method!

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • key

      protected me.wolfyscript.utilities.util.NamespacedKey key
    • slots

      protected int[] slots
      These are the slots selected by the merge option. For crafting recipes they indicate the Ingredient id/s. For any other recipe with fixed slots they indicate the inventory slot.
  • Constructor Details

    • MergeAdapter

      protected MergeAdapter(me.wolfyscript.utilities.util.NamespacedKey key)
    • MergeAdapter

      protected MergeAdapter(MergeAdapter adapter)
  • Method Details

    • getNamespacedKey

      public me.wolfyscript.utilities.util.NamespacedKey getNamespacedKey()
      Specified by:
      getNamespacedKey in interface me.wolfyscript.utilities.util.Keyed
    • merge

      public abstract 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)
      Called when the data is merged inside of recipes like Furnace, Smithing Table, etc.
      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. for the 2x2 player crafting grid!
      customResult - The CustomItem of the crafted item.
      result - The actual manipulable result ItemStack. Previous adapters might have already manipulated this item!
      Returns:
      The manipulated ItemStack that should be passed to the next adapter or set as the end result.
    • clone

      public abstract MergeAdapter clone()
      Overrides:
      clone in class Object
    • mergeCrafting

      @Deprecated public org.bukkit.inventory.ItemStack mergeCrafting(CraftingData craftingData, org.bukkit.entity.Player player, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
      Deprecated.
      Replaced with merge(RecipeData, Player, Block, CustomItem, ItemStack)! All recipe types call that one method!
    • merge

      @Deprecated public org.bukkit.inventory.ItemStack merge(org.bukkit.inventory.ItemStack[] ingredients, @Nullable @Nullable org.bukkit.entity.Player player, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)
      Deprecated.