Class PlexModule

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

public abstract class PlexModule extends Object
  • 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)