Class ResultTarget
java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.target.ResultTarget
- Direct Known Subclasses:
FixedResultTarget,NoneResultTarget,SlotResultTarget
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOption(MergeOption option)Adds aMergeOptionto the Target.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 customItemResult, org.bukkit.inventory.ItemStack result)Merges the nbt of recipes onto the resultingItemStackusing the specifiedMergeOptions
-
Constructor Details
-
ResultTarget
protected ResultTarget() -
ResultTarget
-
-
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 customItemResult, org.bukkit.inventory.ItemStack result)Merges the nbt of recipes onto the resultingItemStackusing the specifiedMergeOptions- 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!customItemResult- TheCustomItemof the crafted item.result- The actual manipulable resultItemStack. Previous adapters might have already manipulated this item!- Returns:
- The final manipulated resulting
ItemStack.
-
addOption
Adds aMergeOptionto the Target.- Parameters:
option- The MergeOption to add.- Returns:
- The
ResultTargetfor chaining this method.
-