Package dev.plex.module
Class PlexModule
java.lang.Object
dev.plex.module.PlexModule
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<PlexCommand> private File
private final List
<PlexListener> private org.apache.logging.log4j.Logger
private Plex
private PlexModuleFile
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDefaultMessage
(String message, Object initValue) Adds a message to the messages.yml filevoid
addDefaultMessage
(String message, Object initValue, String... comments) Adds a message to the messages.yml with a commentvoid
disable()
void
enable()
getCommand
(String name) @Nullable InputStream
getResource
(@NotNull String filename) void
load()
void
registerCommand
(PlexCommand command) Registers a PlexCommand within a modulevoid
registerListener
(PlexListener listener) Registers a PlexListener within a modulevoid
unregisterCommand
(PlexCommand command) Unregisters a PlexCommand.void
unregisterListener
(PlexListener listener) Unregisters a PlexListener.
-
Field Details
-
commands
-
listeners
-
plex
-
plexModuleFile
-
dataFolder
-
logger
private org.apache.logging.log4j.Logger logger
-
-
Constructor Details
-
PlexModule
public PlexModule()
-
-
Method Details
-
load
public void load() -
enable
public void enable() -
disable
public void disable() -
registerListener
Registers a PlexListener within a module- Parameters:
listener
- The PlexListener to be registered
-
unregisterListener
Unregisters a PlexListener. Handled by Plex automatically- Parameters:
listener
- The PlexListener to be registered
-
registerCommand
Registers a PlexCommand within a module- Parameters:
command
- The PlexCommand to be registered
-
unregisterCommand
Unregisters a PlexCommand. Handled by Plex automatically- Parameters:
command
- The PlexCommand to be registered
-
getCommand
-
addDefaultMessage
Adds a message to the messages.yml file- Parameters:
message
- The key value for the messageinitValue
- The message itself
-
addDefaultMessage
Adds a message to the messages.yml with a comment- Parameters:
message
- The key value for the messageinitValue
- The message itselfcomments
- The comments to be placed above the message
-
getResource
-