Package dev.plex.module

# Class PlexModule

java.lang.Object
dev.plex.module.PlexModule

public abstract class PlexModule extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`private final List<PlexCommand>`
`commands`
`private File`
`dataFolder`
`private final List<PlexListener>`
`listeners`
`private org.apache.logging.log4j.Logger`
`logger`
`private Plex`
`plex`
`private PlexModuleFile`
`plexModuleFile`

## Constructor Summary

Constructors
Constructor
Description
`PlexModule()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addDefaultMessage(String message, Object initValue)`
Adds a message to the messages.yml file
`void`
`addDefaultMessage(String message, Object initValue, String... comments)`
Adds a message to the messages.yml with a comment
`void`
`disable()`
`void`
`enable()`
`PlexCommand`
`getCommand(String name)`
`@Nullable InputStream`
`getResource(@NotNull String filename)`
`void`
`load()`
`void`
`registerCommand(PlexCommand command)`
Registers a PlexCommand within a module
`void`
`registerListener(PlexListener listener)`
Registers a PlexListener within a module
`void`
`unregisterCommand(PlexCommand command)`
Unregisters a PlexCommand.
`void`
`unregisterListener(PlexListener listener)`
Unregisters a PlexListener.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### commands

private final List<PlexCommand> commands

### listeners

private final List<PlexListener> listeners

### plex

private Plex plex

### plexModuleFile

private PlexModuleFile plexModuleFile

### dataFolder

private File 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

public void registerListener(PlexListener listener)
Registers a PlexListener within a module

Parameters:
  `listener` - The PlexListener to be registered

### unregisterListener

public void unregisterListener(PlexListener listener)
Unregisters a PlexListener. Handled by Plex automatically

Parameters:
  `listener` - The PlexListener to be registered

### registerCommand

public void registerCommand(PlexCommand command)
Registers a PlexCommand within a module

Parameters:
  `command` - The PlexCommand to be registered

### unregisterCommand

public void unregisterCommand(PlexCommand command)
Unregisters a PlexCommand. Handled by Plex automatically

Parameters:
  `command` - The PlexCommand to be registered

### getCommand

public PlexCommand getCommand(String name)

### addDefaultMessage

public void addDefaultMessage(String message, Object initValue)
Adds a message to the messages.yml file

Parameters:
  `message` - The key value for the message
  `initValue` - The message itself

### addDefaultMessage

public void addDefaultMessage(String message, Object initValue, String... comments)
Adds a message to the messages.yml with a comment

Parameters:
  `message` - The key value for the message
  `initValue` - The message itself
  `comments` - The comments to be placed above the message

### getResource

@Nullable public @Nullable InputStream getResource(@NotNull @NotNull String filename)