Class PlaceholderAPIMergeAdapter

java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.target.MergeAdapter
me.wolfyscript.customcrafting.utils.recipe_item.target.adapters.PlaceholderAPIMergeAdapter
All Implemented Interfaces:
me.wolfyscript.utilities.util.Keyed

public class PlaceholderAPIMergeAdapter extends MergeAdapter
This MergeAdapter shows another functionality it can be used for.

Using this adapter you can replace placeholders of the resulting item before it's even taken out of the inventory.
Providing a preview for the player to tell what he will actually craft.

  • Constructor Details

    • PlaceholderAPIMergeAdapter

      public PlaceholderAPIMergeAdapter()
    • PlaceholderAPIMergeAdapter

      public PlaceholderAPIMergeAdapter(PlaceholderAPIMergeAdapter adapter)
  • 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)
      Description copied from class: MergeAdapter
      Called when the data is merged inside of recipes like Furnace, Smithing Table, etc.
      Specified by:
      merge in class MergeAdapter
      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.
    • isReplaceLore

      public boolean isReplaceLore()
    • isReplaceName

      public boolean isReplaceName()
    • clone

      public MergeAdapter clone()
      Specified by:
      clone in class MergeAdapter