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
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.
-
Field Summary
Fields inherited from class me.wolfyscript.customcrafting.utils.recipe_item.target.MergeAdapter
key, slots
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
boolean
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.Methods inherited from class me.wolfyscript.customcrafting.utils.recipe_item.target.MergeAdapter
getNamespacedKey, merge, mergeCrafting
-
Constructor Details
-
PlaceholderAPIMergeAdapter
public PlaceholderAPIMergeAdapter() -
PlaceholderAPIMergeAdapter
-
-
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 classMergeAdapter
- Parameters:
recipeData
- TheRecipeData
, 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
- TheCustomItem
of the crafted item.result
- The actual manipulable resultItemStack
. 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
- Specified by:
clone
in classMergeAdapter
-