java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.RecipeItemStack
me.wolfyscript.customcrafting.utils.recipe_item.Result<T>

public class Result<T extends ResultTarget> extends RecipeItemStack
  • Constructor Details

    • Result

      public Result()
    • Result

      public Result(Result<T> 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

      public Result(List<me.wolfyscript.utilities.api.inventory.custom_items.references.APIReference> references, Set<me.wolfyscript.utilities.util.NamespacedKey> tags)
  • Method Details

    • clone

      public Result<T> clone()
      Specified by:
      clone in class RecipeItemStack
    • setTarget

      public void setTarget(T target)
    • getTarget

      public T getTarget()
    • getExtensions

      public List<ResultExtension> getExtensions()
    • addExtension

      public void addExtension(ResultExtension extension)
    • removeExtension

      public void removeExtension(ResultExtension extension)
    • 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 - The Block 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 of getItem(Player) and getItem(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 - The Block 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)