Class AsyncRecipeChoiceTask

java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.tasks.AsyncRecipeChoiceTask
All Implemented Interfaces:
Runnable

public class AsyncRecipeChoiceTask extends Object implements Runnable
A AsyncRecipeChoiceTask is an asynchronously repeating task that cycles through the different variants of Material that a RecipeChoice.MaterialChoice or Tag can represent. It is used in the SurvivalSlimefunGuide for any ItemStack from Minecraft that accepts more than one Material in its Recipe.
Author:
TheBusyBiscuit
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int slot, org.bukkit.inventory.RecipeChoice.MaterialChoice choice)
     
    void
    add(int slot, org.bukkit.Tag<org.bukkit.Material> tag)
     
    void
    This method clears the AsyncRecipeChoiceTask and removes all active iterators.
    boolean
    This method checks if there are any slots that need to be updated.
    void
    run()
     
    void
    start(org.bukkit.inventory.Inventory inv)
    This will start this task for the given Inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AsyncRecipeChoiceTask

      public AsyncRecipeChoiceTask()
  • Method Details

    • start

      public void start(@Nonnull org.bukkit.inventory.Inventory inv)
      This will start this task for the given Inventory.
      Parameters:
      inv - The Inventory to start this task for
    • add

      public void add(int slot, @Nonnull org.bukkit.inventory.RecipeChoice.MaterialChoice choice)
    • add

      public void add(int slot, @Nonnull org.bukkit.Tag<org.bukkit.Material> tag)
    • isEmpty

      public boolean isEmpty()
      This method checks if there are any slots that need to be updated.
      Returns:
      Whether this task has nothing to do
    • clear

      public void clear()
      This method clears the AsyncRecipeChoiceTask and removes all active iterators.
    • run

      public void run()
      Specified by:
      run in interface Runnable