Package dev.plex.module
Class PlexModule
java.lang.Object
dev.plex.module.PlexModule
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<PlexCommand> private Fileprivate final List<PlexListener> private org.apache.logging.log4j.Loggerprivate Plexprivate PlexModuleFile -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefaultMessage(String message, Object initValue) Adds a message to the messages.yml filevoidaddDefaultMessage(String message, Object initValue, String... comments) Adds a message to the messages.yml with a commentvoiddisable()voidenable()getCommand(String name) @Nullable InputStreamgetResource(@NotNull String filename) voidload()voidregisterCommand(PlexCommand command) Registers a PlexCommand within a modulevoidregisterListener(PlexListener listener) Registers a PlexListener within a modulevoidunregisterCommand(PlexCommand command) Unregisters a PlexCommand.voidunregisterListener(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
-