Class MergeOption
java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.target.MergeOption
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMergeOption(int[] slots, MergeAdapter... adapters)MergeOption(MergeOption mergeOption) -
Method Summary
Modifier and TypeMethodDescriptionclone()int[]getSlots()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)Merges the nbt of recipes onto the resultingItemStackusing the specifiedMergeAdapters.voidsetAdapters(List<MergeAdapter> adapters)voidsetSlots(int[] slots)
-
Constructor Details
-
MergeOption
protected MergeOption() -
MergeOption
-
MergeOption
-
-
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)Merges the nbt of recipes onto the resultingItemStackusing the specifiedMergeAdapters. The order in which the adapters are called is the same order as they were added.- 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. 2x2 player crafting grid, inventories with an associated block, etc.!customResult- TheCustomItemof the crafted item.result- The actual manipulable resultItemStack. Previous adapters might have already manipulated this item!- Returns:
- The final manipulated resulting
ItemStackof this option, that will be passed to the next option if one is available.
-
getSlots
public int[] getSlots() -
setSlots
public void setSlots(int[] slots) -
setAdapters
-
clone
-