Class PaperCommandRegistration<Source>

java.lang.Object
dev.jorel.commandapi.CommandRegistrationStrategy<Source>
dev.jorel.commandapi.PaperCommandRegistration<Source>

public class PaperCommandRegistration<Source> extends dev.jorel.commandapi.CommandRegistrationStrategy<Source>
Handles logic for registering commands after Paper build 65, where https://github.com/PaperMC/Paper/pull/8235 changed a bunch of the behind-the-scenes logic.
  • Constructor Details

    • PaperCommandRegistration

      public PaperCommandRegistration(Supplier<com.mojang.brigadier.CommandDispatcher<Source>> getBrigadierDispatcher, Predicate<com.mojang.brigadier.tree.CommandNode<Source>> isBukkitCommand)
  • Method Details

    • isBukkitCommand

      public boolean isBukkitCommand(com.mojang.brigadier.tree.CommandNode<Source> node)
      Checks if a Brigadier command node came from wrapping a Bukkit command
      Parameters:
      node - The CommandNode to check
      Returns:
      true if the CommandNode is being handled by Paper's BukkitCommandNode
    • getBrigadierDispatcher

      public com.mojang.brigadier.CommandDispatcher<Source> getBrigadierDispatcher()
      Specified by:
      getBrigadierDispatcher in class dev.jorel.commandapi.CommandRegistrationStrategy<Source>
    • registerCommandNode

      public com.mojang.brigadier.tree.LiteralCommandNode<Source> registerCommandNode(com.mojang.brigadier.builder.LiteralArgumentBuilder<Source> node, String namespace)
      Specified by:
      registerCommandNode in class dev.jorel.commandapi.CommandRegistrationStrategy<Source>
    • unregister

      public void unregister(String commandName, boolean unregisterNamespaces, boolean unregisterBukkit)
      Specified by:
      unregister in class dev.jorel.commandapi.CommandRegistrationStrategy<Source>
    • preReloadDataPacks

      public void preReloadDataPacks()
      Specified by:
      preReloadDataPacks in class dev.jorel.commandapi.CommandRegistrationStrategy<Source>
    • canRegister

      public boolean canRegister()
      Overrides:
      canRegister in class dev.jorel.commandapi.CommandRegistrationStrategy<Source>