Interface IListenerRegistrationHandler


public interface IListenerRegistrationHandler
Handles registration of additional listeners that will be invoked at certain points during CraftTweaker's lifecycle.

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 Details

    • onZenDataRegistrationCompletion

      void onZenDataRegistrationCompletion(Runnable runnable)
      Registers the given Runnable as 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

      void onCraftTweakerLoadCompletion(Runnable runnable)
      Registers the given Runnable as 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_NAME is called.

      Parameters:
      runnable - The runnable that will be invoked.
      Since:
      9.1.0
    • onExecuteRun

      void onExecuteRun(Consumer<ScriptRunConfiguration> executionConsumer)