Class Result<T extends ResultTarget>
java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.RecipeItemStack
me.wolfyscript.customcrafting.utils.recipe_item.Result<T>
-
Field Summary
Fields inherited from class me.wolfyscript.customcrafting.utils.recipe_item.RecipeItemStack
choices
-
Constructor Summary
ConstructorsConstructorDescriptionResult()
Result(List<me.wolfyscript.utilities.api.inventory.custom_items.references.APIReference> references, Set<me.wolfyscript.utilities.util.NamespacedKey> tags)
Result(me.wolfyscript.utilities.api.inventory.custom_items.references.APIReference... references)
Result(me.wolfyscript.utilities.util.NamespacedKey... tags)
Result(org.bukkit.inventory.ItemStack... items)
Result(org.bukkit.Material... materials)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExtension(ResultExtension extension)
clone()
void
executeExtensions(@NotNull org.bukkit.Location location, boolean isWorkstation, @Nullable org.bukkit.entity.Player player)
Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem>
getItem(@NotNull org.bukkit.block.Block block)
Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem>
getItem(@Nullable org.bukkit.entity.Player player)
Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem>
getItem(@Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.block.Block block)
Combination ofgetItem(Player)
andgetItem(Block)
.org.bukkit.inventory.ItemStack
getItem(RecipeData<?> recipeData, @Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.block.Block block)
org.bukkit.inventory.ItemStack
getItem(RecipeData<?> recipeData, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem chosenItem, @Nullable org.bukkit.entity.Player player, @Nullable org.bukkit.block.Block block)
me.wolfyscript.utilities.util.RandomCollection<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem>
getRandomChoices(@Nullable org.bukkit.entity.Player player)
void
removeCachedItem(org.bukkit.block.Block block)
void
removeCachedItem(org.bukkit.entity.Player player)
void
removeExtension(int index)
void
removeExtension(ResultExtension extension)
void
Methods inherited from class me.wolfyscript.customcrafting.utils.recipe_item.RecipeItemStack
buildChoices, getBukkitChoices, getChoices, getChoices, getChoicesStream, getItems, getItemStack, getItemStack, getTags, isEmpty, put, setItems, setTags, size, toString
-
Constructor Details
-
Result
public Result() -
Result
-
Result
public Result(org.bukkit.Material... materials) -
Result
public Result(org.bukkit.inventory.ItemStack... items) -
Result
public Result(me.wolfyscript.utilities.util.NamespacedKey... tags) -
Result
public Result(me.wolfyscript.utilities.api.inventory.custom_items.references.APIReference... references) -
Result
-
-
Method Details
-
clone
- Specified by:
clone
in classRecipeItemStack
-
setTarget
-
getTarget
-
getExtensions
-
addExtension
-
removeExtension
-
removeExtension
public void removeExtension(int index) -
getRandomChoices
public me.wolfyscript.utilities.util.RandomCollection<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem> getRandomChoices(@Nullable @Nullable org.bukkit.entity.Player player) -
getItem
public Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem> getItem(@Nullable @Nullable org.bukkit.entity.Player player)- Parameters:
player
- The player to get the result for.- Returns:
- The optional
CustomItem
for that player. This might be a cached Item if the player hasn't taken it out previously.
-
getItem
public Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem> getItem(@NotNull @NotNull org.bukkit.block.Block block)- Parameters:
block
- TheBlock
to get the result for.- Returns:
- The optional
CustomItem
for that block. This might be a cached Item if the block failed to processed it.
-
getItem
public Optional<me.wolfyscript.utilities.api.inventory.custom_items.CustomItem> getItem(@Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.block.Block block)Combination ofgetItem(Player)
andgetItem(Block)
.If the player is available it returns the item for the player.
If the player is null, but the block is available it returns the item for the block.- Parameters:
player
- The player to get the result for.block
- TheBlock
to get the result for.- Returns:
- Either the item for the player or block, depending on which one is available.
-
getItem
public org.bukkit.inventory.ItemStack getItem(RecipeData<?> recipeData, @Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.block.Block block) -
getItem
public org.bukkit.inventory.ItemStack getItem(RecipeData<?> recipeData, me.wolfyscript.utilities.api.inventory.custom_items.CustomItem chosenItem, @Nullable @Nullable org.bukkit.entity.Player player, @Nullable @Nullable org.bukkit.block.Block block) -
removeCachedItem
public void removeCachedItem(org.bukkit.entity.Player player) -
removeCachedItem
public void removeCachedItem(org.bukkit.block.Block block) -
executeExtensions
public void executeExtensions(@NotNull @NotNull org.bukkit.Location location, boolean isWorkstation, @Nullable @Nullable org.bukkit.entity.Player player)
-