Class MergeAdapter
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMergeAdapter(MergeAdapter adapter)protectedMergeAdapter(me.wolfyscript.utilities.util.NamespacedKey key) -
Method Summary
Modifier and TypeMethodDescriptionabstract MergeAdapterclone()me.wolfyscript.utilities.util.NamespacedKeyabstract org.bukkit.inventory.ItemStackmerge(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.ItemStackmerge(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.ItemStackmergeCrafting(CraftingData craftingData, org.bukkit.entity.Player player, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem customResult, org.bukkit.inventory.ItemStack result)Deprecated.Replaced withmerge(RecipeData, Player, Block, CustomItem, ItemStack)! All recipe types call that one method!
-
Field Details
-
key
protected me.wolfyscript.utilities.util.NamespacedKey key -
slots
protected int[] slotsThese 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
-
-
Method Details
-
getNamespacedKey
public me.wolfyscript.utilities.util.NamespacedKey getNamespacedKey()- Specified by:
getNamespacedKeyin interfaceme.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- 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- TheCustomItemof the crafted item.result- The actual manipulable resultItemStack. Previous adapters might have already manipulated this item!- Returns:
- The manipulated
ItemStackthat should be passed to the next adapter or set as the end result.
-
clone
-
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 withmerge(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.Not called! Replaced withmerge(RecipeData, Player, Block, CustomItem, ItemStack)!
-
merge(RecipeData, Player, Block, CustomItem, ItemStack)!