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 aMergeOption
to the Target.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 customItemResult, org.bukkit.inventory.ItemStack result)
Merges the nbt of recipes onto the resultingItemStack
using the specifiedMergeOption
s
-
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 resultingItemStack
using the specifiedMergeOption
s- 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
- TheCustomItem
of the crafted item.result
- The actual manipulable resultItemStack
. Previous adapters might have already manipulated this item!- Returns:
- The final manipulated resulting
ItemStack
.
-
addOption
Adds aMergeOption
to the Target.- Parameters:
option
- The MergeOption to add.- Returns:
- The
ResultTarget
for chaining this method.
-