Package wtf.choco.alchema.cauldron
Class CauldronUpdateHandler
java.lang.Object
wtf.choco.alchema.cauldron.CauldronUpdateHandler
public final class CauldronUpdateHandler
extends java.lang.Object
Responsible for the updating and ticking of in-world
AlchemicalCauldron
instances.- Author:
- Parker Hawke - Choco
-
Method Summary
Modifier and Type Method Description boolean
cancelTask()
Cancel the update task.static @NotNull CauldronUpdateHandler
get()
Get the cauldron update task instance if it exists.static @NotNull CauldronUpdateHandler
init(@NotNull Alchema plugin)
Initialize the singletonCauldronUpdateHandler
.void
markAsDirty()
Mark this cauldron update task as dirty.void
startTask()
Start the update task.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
markAsDirty
public void markAsDirty()Mark this cauldron update task as dirty.When marked as dirty, this update task will re-fetch cached configuration values from Alchema's configuration file.
-
startTask
public void startTask()Start the update task. If the task was already started, an exception will be thrown. -
cancelTask
public boolean cancelTask()Cancel the update task.- Returns:
- true if the task was cancelled, false if no task was running
-
get
Get the cauldron update task instance if it exists.If this method is called before
init(Alchema)
, an exception will be thrown.- Returns:
- the update task instance
-
init
Initialize the singletonCauldronUpdateHandler
.NOTE: This is for internal use only
- Parameters:
plugin
- the plugin to initialize the handler- Returns:
- the task instance
-