Class ModulePlugin

java.lang.Object
eu.locklogin.api.module.plugin.javamodule.ModulePlugin

public final class ModulePlugin extends Object
LockLogin java module manager
  • Constructor Details

    • ModulePlugin

      public ModulePlugin(PluginModule owner)
      Initialize the java module manager
      Parameters:
      owner - the owner module
  • Method Details

    • getCommandsData

      public static Set<CommandData> getCommandsData()
      Get the module commands data
      Returns:
      the module commands data
    • callEvent

      public static void callEvent(Event event)
      Call an event to all the listeners
      Parameters:
      event - the event to call
    • fireCommand

      public static void fireCommand(ModuleSender sender, String cmd, Object parentEvent)
      Fire a command
      Parameters:
      sender - the command sender
      cmd - the command
      parentEvent - the parent event
    • getCommandOwner

      public static PluginModule getCommandOwner(String command)
      Get the module that owns the specified command
      Parameters:
      command - the command
      Returns:
      the module owning the specified command
    • parseCommand

      public static boolean parseCommand(String message)
      Get if the parser can parse the command
      Parameters:
      message - the message the player has sent
      Returns:
      if the module parser can parse the command
    • registerListener

      public void registerListener(EventListener event) throws IllegalStateException
      Register a new listener to the module
      Parameters:
      event - the event listener to register
      Throws:
      IllegalStateException - if the module tries to register a listener while not loaded
    • registerCommand

      public void registerCommand(Command command) throws IllegalStateException
      Register a new command to the module
      Parameters:
      command - the command to register
      Throws:
      IllegalStateException - if the module tries to register a command while not registered
    • unregisterListener

      public void unregisterListener(EventListener event)
      Remove a listener from the registered listeners
      Parameters:
      event - the listener to remove
    • unregisterCommand

      public void unregisterCommand(Command command)
      Unregister a command from the registered commands
      Parameters:
      command - the command to remove
    • unregisterListeners

      public void unregisterListeners()
      Unregister all the listeners
    • unregisterCommands

      public void unregisterCommands()
      Unregister all the commands
    • getRegisteredListeners

      public Set<EventListener> getRegisteredListeners()
      Get all the registered listeners
      Returns:
      all the registered listeners
    • getRegisteredCommands

      public Set<Command> getRegisteredCommands()
      Get all the registered commands
      Returns:
      all the registered commands
    • getVersionManager

      public JavaModuleVersion getVersionManager()
      Get the module version manager
      Returns:
      the module version manager
    • getMessenger

      public Object getMessenger()
      Get the module messenger
      Returns:
      the module messenger