Class PluginYAMLManager

java.lang.Object
me.yleoft.zAPI.managers.PluginYAMLManager

public abstract class PluginYAMLManager extends Object
PluginYAMLManager class to manage commands and permissions for a Bukkit plugin. It allows registering and unregistering commands and permissions dynamically.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.bukkit.command.TabExecutor
    CommandExecutor that does nothing and returns false.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    registerCommand(@NotNull String command, @NotNull org.bukkit.command.CommandExecutor ce, @NotNull String description, @NotNull String... aliases)
    Registers a command with the specified name, executor, description, and aliases.
    static void
    registerCommand(@NotNull String command, @NotNull org.bukkit.command.CommandExecutor ce, @NotNull org.bukkit.command.TabCompleter completer, @NotNull String description, @NotNull String... aliases)
    Registers a command with the specified name, executor, tab completer, description, and aliases.
    static void
    registerEvent(@NotNull org.bukkit.event.Listener l)
    Registers a Listener for the plugin.
    static void
    registerPermission(@NotNull String permission)
     
    static void
    registerPermission(@NotNull String permission, @NotNull String description)
     
    static void
    registerPermission(@NotNull String permission, @NotNull String description, @NotNull org.bukkit.permissions.PermissionDefault def)
     
    static void
    registerPermission(@NotNull String permission, @NotNull String description, @NotNull org.bukkit.permissions.PermissionDefault def, @NotNull Map<String,Boolean> children)
     
    static void
    registerPermission(@NotNull String permission, @NotNull org.bukkit.permissions.PermissionDefault def)
     
    static void
    registerTabCompleter(@NotNull String command, @NotNull org.bukkit.command.TabCompleter tc)
    Registers a TabCompleter for the specified command.
    static void
    Syncs the commands registered in the server.
    static void
    Unregisters all commands registered by this plugin.
    static void
    unregisterPermission(@NotNull String permission)
     
    static void
    unregisterPermission(@NotNull org.bukkit.permissions.Permission permission)
     
    static void
    Unregisters all permissions registered by this plugin.

    Methods inherited from class java.lang.Object

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

    • emptyExec

      public static final org.bukkit.command.TabExecutor emptyExec
      CommandExecutor that does nothing and returns false. This is used as a placeholder for commands that are not registered.
  • Constructor Details

    • PluginYAMLManager

      public PluginYAMLManager()
  • Method Details

    • syncCommands

      public static void syncCommands()
      Syncs the commands registered in the server. This method is used to ensure that all commands are properly registered.
    • unregisterCommands

      public static void unregisterCommands()
      Unregisters all commands registered by this plugin. This method is used to clean up commands when the plugin is disabled or reloaded.
    • registerCommand

      public static void registerCommand(@NotNull @NotNull String command, @NotNull @NotNull org.bukkit.command.CommandExecutor ce, @NotNull @NotNull String description, @NotNull @NotNull String... aliases)
      Registers a command with the specified name, executor, description, and aliases.
      Parameters:
      command - The name of the command.
      ce - The CommandExecutor for the command.
      description - The description of the command.
      aliases - The aliases for the command.
    • registerCommand

      public static void registerCommand(@NotNull @NotNull String command, @NotNull @NotNull org.bukkit.command.CommandExecutor ce, @NotNull @NotNull org.bukkit.command.TabCompleter completer, @NotNull @NotNull String description, @NotNull @NotNull String... aliases)
      Registers a command with the specified name, executor, tab completer, description, and aliases.
      Parameters:
      command - The name of the command.
      ce - The CommandExecutor for the command.
      completer - The TabCompleter for the command.
      description - The description of the command.
      aliases - The aliases for the command.
    • unregisterPermissions

      public static void unregisterPermissions()
      Unregisters all permissions registered by this plugin.
    • unregisterPermission

      public static void unregisterPermission(@NotNull @NotNull String permission)
    • unregisterPermission

      public static void unregisterPermission(@NotNull @NotNull org.bukkit.permissions.Permission permission)
    • registerPermission

      public static void registerPermission(@NotNull @NotNull String permission)
    • registerPermission

      public static void registerPermission(@NotNull @NotNull String permission, @NotNull @NotNull String description)
    • registerPermission

      public static void registerPermission(@NotNull @NotNull String permission, @NotNull @NotNull org.bukkit.permissions.PermissionDefault def)
    • registerPermission

      public static void registerPermission(@NotNull @NotNull String permission, @NotNull @NotNull String description, @NotNull @NotNull org.bukkit.permissions.PermissionDefault def)
    • registerPermission

      public static void registerPermission(@NotNull @NotNull String permission, @NotNull @NotNull String description, @NotNull @NotNull org.bukkit.permissions.PermissionDefault def, @NotNull @NotNull Map<String,Boolean> children)
    • registerTabCompleter

      public static void registerTabCompleter(@NotNull @NotNull String command, @NotNull @NotNull org.bukkit.command.TabCompleter tc)
      Registers a TabCompleter for the specified command.
      Parameters:
      command - The name of the command.
      tc - The TabCompleter for the command.
    • registerEvent

      public static void registerEvent(@NotNull @NotNull org.bukkit.event.Listener l)
      Registers a Listener for the plugin.
      Parameters:
      l - The Listener to register.