Class PaperImplementations

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

public class PaperImplementations extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    PaperImplementations(boolean isPaperPresent, NMS<?> nmsInstance)
    Constructs a PaperImplementations object
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.command.CommandMap
     
    boolean
     
    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

    Methods inherited from class java.lang.Object

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

    • PaperImplementations

      public PaperImplementations(boolean isPaperPresent, NMS<?> nmsInstance)
      Constructs a PaperImplementations object
      Parameters:
      isPaperPresent - Whether this is a Paper 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
    • isPresent

      public boolean isPresent()
      Returns:
      whether we're using paper or not