CommandAPI 9.4.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.PaperImplementations Class Reference

Public Member Functions

 PaperImplementations (boolean isPaperPresent, boolean isFoliaPresent, NMS<?> nmsInstance)
 Constructs a PaperImplementations object. More...
 
void registerReloadHandler (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. More...
 
CommandMap getCommandMap ()
 
boolean isPaperPresent ()
 
boolean isFoliaPresent ()
 
Class<? extends CommandSender > getFeedbackForwardingCommandSender ()
 
WrapperCommandSyntaxException getExceptionFromString (String message)
 Builds a WrapperCommandSyntaxException from a message with colour codes like ChatColor or using the § symbol. More...
 

Constructor & Destructor Documentation

◆ PaperImplementations()

dev.jorel.commandapi.PaperImplementations.PaperImplementations ( boolean  isPaperPresent,
boolean  isFoliaPresent,
NMS<?>  nmsInstance 
)

Constructs a PaperImplementations object.

Parameters
isPaperPresentWhether this is a Paper server or not
isFoliaPresentWhether this is a Folia server or not
nmsInstanceThe instance of NMS

Member Function Documentation

◆ getCommandMap()

CommandMap dev.jorel.commandapi.PaperImplementations.getCommandMap ( )
Returns
Bukkit's CommandMap

◆ getExceptionFromString()

WrapperCommandSyntaxException dev.jorel.commandapi.PaperImplementations.getExceptionFromString ( String  message)

Builds a WrapperCommandSyntaxException from a message with colour codes like ChatColor or using the § symbol.

Parameters
messagethe error message to be displayed
Returns
A WrapperCommandSyntaxException with the given message as error message

◆ getFeedbackForwardingCommandSender()

Class<? extends CommandSender > dev.jorel.commandapi.PaperImplementations.getFeedbackForwardingCommandSender ( )
Returns
a class reference pointing to io.papermc.paper.commands.FeedbackForwardingSender

◆ isFoliaPresent()

boolean dev.jorel.commandapi.PaperImplementations.isFoliaPresent ( )
Returns
whether we're using folia or not

◆ isPaperPresent()

boolean dev.jorel.commandapi.PaperImplementations.isPaperPresent ( )
Returns
whether we're using paper or not

◆ registerReloadHandler()

void dev.jorel.commandapi.PaperImplementations.registerReloadHandler ( 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
pluginthe plugin that the CommandAPI is being used from