Class PaperImplementations

java.lang.Object
dev.jorel.commandapi.PaperImplementations

public class PaperImplementations extends Object
  • Constructor Details

    • PaperImplementations

      public PaperImplementations(boolean isPaperPresent, boolean isFoliaPresent, NMS<?> nmsInstance)
      Constructs a PaperImplementations object
      Parameters:
      isPaperPresent - Whether this is a Paper server or not
      isFoliaPresent - Whether this is a Folia server or not
      nmsInstance - The instance of NMS
  • Method Details

    • registerReloadHandler

      public void registerReloadHandler(org.bukkit.plugin.Plugin plugin)
      Hooks into Paper's ServerResourcesReloadedEvent to detect if /minecraft:reload is called, and registers a reload handler that automatically calls the CommandAPI's internal datapack reloading function
      Parameters:
      plugin - the plugin that the CommandAPI is being used from
    • getCommandMap

      public org.bukkit.command.CommandMap getCommandMap()
      Returns:
      Bukkit's CommandMap
    • isPaperPresent

      public boolean isPaperPresent()
      Returns:
      whether we're using paper or not
    • isFoliaPresent

      public boolean isFoliaPresent()
      Returns:
      whether we're using folia or not
    • getFeedbackForwardingCommandSender

      public Class<? extends org.bukkit.command.CommandSender> getFeedbackForwardingCommandSender()
      Returns:
      a class reference pointing to io.papermc.paper.commands.FeedbackForwardingSender
    • getExceptionFromString

      public WrapperCommandSyntaxException getExceptionFromString(String message)
      Builds a WrapperCommandSyntaxException from a message with colour codes like ChatColor or using the § symbol.
      Parameters:
      message - the error message to be displayed
      Returns:
      A WrapperCommandSyntaxException with the given message as error message