Class ModulePlugin
java.lang.Object
eu.locklogin.api.module.plugin.javamodule.ModulePlugin
LockLogin java module manager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Call an event to all the listenersstatic void
fireCommand(ModuleSender sender, String cmd, Object parentEvent)
Fire a commandstatic PluginModule
getCommandOwner(String command)
Get the module that owns the specified commandstatic Set<CommandData>
Get the module commands dataGet the module messengerGet all the registered commandsGet all the registered listenersGet the module version managerstatic boolean
parseCommand(String message)
Get if the parser can parse the commandvoid
registerCommand(Command command)
Register a new command to the modulevoid
registerListener(EventListener event)
Register a new listener to the modulevoid
unregisterCommand(Command command)
Unregister a command from the registered commandsvoid
Unregister all the commandsvoid
unregisterListener(EventListener event)
Remove a listener from the registered listenersvoid
Unregister all the listeners
-
Constructor Details
-
ModulePlugin
Initialize the java module manager- Parameters:
owner
- the owner module
-
-
Method Details
-
getCommandsData
Get the module commands data- Returns:
- the module commands data
-
callEvent
Call an event to all the listeners- Parameters:
event
- the event to call
-
fireCommand
Fire a command- Parameters:
sender
- the command sendercmd
- the commandparentEvent
- the parent event
-
getCommandOwner
Get the module that owns the specified command- Parameters:
command
- the command- Returns:
- the module owning the specified command
-
parseCommand
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
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
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
Remove a listener from the registered listeners- Parameters:
event
- the listener to remove
-
unregisterCommand
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
Get all the registered listeners- Returns:
- all the registered listeners
-
getRegisteredCommands
Get all the registered commands- Returns:
- all the registered commands
-
getVersionManager
Get the module version manager- Returns:
- the module version manager
-
getMessenger
Get the module messenger- Returns:
- the module messenger
-