Package net.lewmc.foundry
Class Registry
java.lang.Object
net.lewmc.foundry.Registry
Command Registry
-
Constructor Summary
ConstructorsConstructorDescriptionRegistry
(FoundryConfig config, org.bukkit.plugin.java.JavaPlugin plugin) Constructor for the class. -
Method Summary
Modifier and TypeMethodDescriptionboolean[]
Registers a command with the server, handling any potential issues.boolean
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.
-
Constructor Details
-
Registry
Constructor for the class.- Parameters:
config
- FoundryConfig - Foundry's configuration.plugin
- Plugin - Reference to the main plugin class.
-
-
Method Details
-
command
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
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
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
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
Alerts the verbose logs of a registration.- Parameters:
type
- String - The type of registration.asset
- String - The asset registered.
-