Class Registry

java.lang.Object
net.lewmc.foundry.Registry

public class Registry extends Object
Command Registry
  • Constructor Summary

    Constructors
    Constructor
    Description
    Registry(FoundryConfig config, org.bukkit.plugin.java.JavaPlugin plugin)
    Constructor for the class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean[]
    command(String[] commands, org.bukkit.command.CommandExecutor executor)
    Registers a command with the server, handling any potential issues.
    boolean
    command(String command, org.bukkit.command.CommandExecutor executor)
    Registers a command with the server, handling any potential issues.
    boolean
    event(org.bukkit.event.Listener event)
    Registers an event with the server, handling any potential issues.
    boolean[]
    tabCompleter(String[] commands, org.bukkit.command.TabCompleter completer)
    Registers a Tab Completer with the server, handling any potential issues.
    boolean
    tabCompleter(String command, org.bukkit.command.TabCompleter completer)
    Registers a Tab Completer with the server, handling any potential issues.
    void
    verboseAlert(String type, String asset)
    Alerts the verbose logs of a registration.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Registry

      public Registry(FoundryConfig config, org.bukkit.plugin.java.JavaPlugin plugin)
      Constructor for the class.
      Parameters:
      config - FoundryConfig - Foundry's configuration.
      plugin - Plugin - Reference to the main plugin class.
  • Method Details

    • command

      public boolean command(String command, org.bukkit.command.CommandExecutor executor)
      Registers a command with the server, handling any potential issues.
      Parameters:
      command - String - The command label, what users type into chat after the / to execute it.
      executor - CommandExecutor - The command executor class.
      Returns:
      boolean - Was the command successfully registered?
    • command

      public boolean[] command(String[] commands, org.bukkit.command.CommandExecutor executor)
      Registers a command with the server, handling any potential issues. Do not use this for aliases, only use it when multiple commands use the same executor.
      Parameters:
      commands - String[] - The command labels, what users type into chat after the / to execute it.
      executor - CommandExecutor - The command executor class.
      Returns:
      boolean[] - Was the command successfully registered? Returns an array.
    • tabCompleter

      public boolean tabCompleter(String command, org.bukkit.command.TabCompleter completer)
      Registers a Tab Completer with the server, handling any potential issues.
      Parameters:
      command - String - The command label, what users type into chat after the / to execute it.
      completer - TabCompleter - The tab completer class.
      Returns:
      boolean - Was the tab completer successfully registered?
    • tabCompleter

      public boolean[] tabCompleter(String[] commands, org.bukkit.command.TabCompleter completer)
      Registers a Tab Completer with the server, handling any potential issues.
      Parameters:
      commands - String - The command label, what users type into chat after the / to execute it.
      completer - TabCompleter - The tab completer class.
      Returns:
      boolean - Was the tab completer successfully registered?
    • event

      public boolean event(org.bukkit.event.Listener event)
      Registers an event with the server, handling any potential issues.
      Parameters:
      event - Listener - The event listener class.
      Returns:
      boolean - Was the event successfully registered?
    • verboseAlert

      public void verboseAlert(String type, String asset)
      Alerts the verbose logs of a registration.
      Parameters:
      type - String - The type of registration.
      asset - String - The asset registered.