Class MCREvent

java.lang.Object
net.mcreator.plugin.MCREvent
Direct Known Subclasses:
ApplicationLoadedEvent, BlocklyPanelRegisterJSObjects, MCreatorLoadedEvent, PreferencesDialogEvent, TabEvent, WorkspaceBuildStartedEvent, WorkspaceRefactoringEvent, WorkspaceSavedEvent, WorkspaceSelectorLoadedEvent

public abstract class MCREvent extends Object
  • Constructor Details

    • MCREvent

      public MCREvent()
  • Method Details

    • event

      public static <T extends MCREvent> void event(T event)
    • isSynchronous

      protected boolean isSynchronous()
      Returns if the event is synchronous. MCreator waits for all synchronous events to finish before continuing with execution. If the event is meant to change value that is needed after the MCREvent.event() call, it should be synchronous.
      Returns:
      if the event is synchronous
    • getTimeout

      protected int getTimeout()
      Returns the timeout for the event. Ignored if the event is not synchronous. If the event is synchronous and the timeout is set to a value greater than 0, MCreator will wait for the event to finish for the given amount of time. If the event does not finish in the given time, MCreator will continue with execution and the event execution will be cancelled. A warning will be logged.

      This is used to prevent a plugin from blocking MCreator execution indefinitely.

      Returns:
      the timeout for the event in milliseconds