Interface IListenerRegistrationHandler
Each listener is essentially a Runnable that will be enqueued and will wait for the right conditions
before being called. This allows plugins to perform additional work when CraftTweaker reaches a certain stage of
loading.
Listeners have no implied ordering guarantees.
- Since:
- 9.1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidonCraftTweakerLoadCompletion(Runnable runnable) Registers the givenRunnableas a listener for when CraftTweaker has completed its initialization cycle.voidonExecuteRun(Consumer<ScriptRunConfiguration> executionConsumer) voidonZenDataRegistrationCompletion(Runnable runnable) Registers the givenRunnableas a listener for when CraftTweaker has finished managing integration with the ZenCode environment.
-
Method Details
-
onZenDataRegistrationCompletion
Registers the givenRunnableas a listener for when CraftTweaker has finished managing integration with the ZenCode environment.The listener will be called as soon as all script-related data has been successfully registered. This includes bracket handlers, loaders, load sources, native types, and zen types.
- Parameters:
runnable- The runnable that will be invoked.- Since:
- 9.1.0
-
onCraftTweakerLoadCompletion
Registers the givenRunnableas a listener for when CraftTweaker has completed its initialization cycle.The listener will thus be called last after all internal CraftTweaker state has been successfully built. Minor operations may have also been carried out by CraftTweaker to set up additional context. It is nevertheless guaranteed that this listener will be called before the loader with the name indicated by
CraftTweakerConstants.INIT_LOADER_NAMEis called.- Parameters:
runnable- The runnable that will be invoked.- Since:
- 9.1.0
-
onExecuteRun
-