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 that is already set up in the plugin.yml file, handling any potential issues.
    boolean
    command(String command, org.bukkit.command.CommandExecutor executor)
    Registers a command with the server that is already set up in the plugin.yml file, handling any potential issues.
    boolean
    event(org.bukkit.event.Listener event)
    Registers an event with the server, handling any potential issues.
    boolean[]
    runtimeCommand(String[] labels, org.bukkit.command.CommandExecutor executor, String... aliases)
    Registers a command with the server that is NOT set up in the plugin.yml file, handling any potential issues.
    boolean
    runtimeCommand(String label, org.bukkit.command.CommandExecutor executor, String... aliases)
    Registers a command with the server that is NOT set up in the plugin.yml file, 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.
    boolean[]
    ymlCommand(String[] labels, org.bukkit.command.CommandExecutor executor)
    Registers a command with the server that is already set up in the plugin.yml file, handling any potential issues.
    boolean
    ymlCommand(String label, org.bukkit.command.CommandExecutor executor)
    Registers a command with the server that is already set up in the plugin.yml file, handling any potential issues.

    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 that is already set up in the plugin.yml file, 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 that is already set up in the plugin.yml file, 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.
    • ymlCommand

      public boolean ymlCommand(String label, org.bukkit.command.CommandExecutor executor)
      Registers a command with the server that is already set up in the plugin.yml file, handling any potential issues.
      Parameters:
      label - 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?
    • ymlCommand

      public boolean[] ymlCommand(String[] labels, org.bukkit.command.CommandExecutor executor)
      Registers a command with the server that is already set up in the plugin.yml file, handling any potential issues. Do not use this for aliases, only use it when multiple commands use the same executor.
      Parameters:
      labels - 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.
    • runtimeCommand

      public boolean runtimeCommand(String label, org.bukkit.command.CommandExecutor executor, String... aliases)
      Registers a command with the server that is NOT set up in the plugin.yml file, handling any potential issues.
      Parameters:
      label - 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?
    • runtimeCommand

      public boolean[] runtimeCommand(String[] labels, org.bukkit.command.CommandExecutor executor, String... aliases)
      Registers a command with the server that is NOT set up in the plugin.yml file, handling any potential issues. Do not use this for aliases, only use it when multiple commands use the same executor.
      Parameters:
      labels - 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.