Package dev.jorel.commandapi
Class CommandAPIBukkitConfig<T extends CommandAPIBukkitConfig<T>>
java.lang.Object
dev.jorel.commandapi.CommandAPIConfig<T>
dev.jorel.commandapi.CommandAPIBukkitConfig<T>
- All Implemented Interfaces:
ChainableBuilder<T>
public abstract class CommandAPIBukkitConfig<T extends CommandAPIBukkitConfig<T>>
extends CommandAPIConfig<T>
A class that contains information needed to configure the CommandAPI on Bukkit-based servers.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandAPIBukkitConfig(String pluginName) Creates a new CommandAPIBukkitConfig object. -
Method Summary
Modifier and TypeMethodDescriptionaddSkipSenderProxy(String... names) addSkipSenderProxy(List<String> names) fallbackToLatestNMS(boolean fallbackToLatestNMS) Sets whether the CommandAPI should fall back to the latest nms version if no implementation for the current version was found.<NBT> TinitializeNBTAPI(Class<NBT> nbtContainerClass, Function<Object, NBT> nbtContainerConstructor) Initializes the CommandAPI's implementation of an NBT API.abstract Tinstance()setNamespace(String namespace) Sets the default namespace to use when register commandsMethods inherited from class dev.jorel.commandapi.CommandAPIConfig
dispatcherFile, enableNetworking, makeNetworkingExceptionsWarnings, missingExecutorImplementationMessage, silentLogs, verboseOutput
-
Constructor Details
-
CommandAPIBukkitConfig
Creates a new CommandAPIBukkitConfig object. Variables in this constructor are required to load the CommandAPI on Bukkit properly.- Parameters:
pluginName- The name of theJavaPluginthat is loading the CommandAPI
-
-
Method Details
-
fallbackToLatestNMS
Sets whether the CommandAPI should fall back to the latest nms version if no implementation for the current version was found.- Parameters:
fallbackToLatestNMS- whether to fall back to the latest versions- Returns:
- this CommandAPIConfig
-
addSkipSenderProxy
-
addSkipSenderProxy
-
initializeNBTAPI
public <NBT> T initializeNBTAPI(Class<NBT> nbtContainerClass, Function<Object, NBT> nbtContainerConstructor) Initializes the CommandAPI's implementation of an NBT API.- Type Parameters:
NBT- the type that the NBT compound container class is- Parameters:
nbtContainerClass- the NBT compound container class. For example,NBTContainer.classnbtContainerConstructor- a function that takes an Object (NMSNBTTagCompound) and returns an instance of the provided NBT compound container. For example,NBTContainer::new.- Returns:
- this CommandAPIConfig
-
setNamespace
Sets the default namespace to use when register commandsThis namespace can't be
nullor empty and has to match the regex:[0-9a-z_.-]+- Overrides:
setNamespacein classCommandAPIConfig<T extends CommandAPIBukkitConfig<T>>- Parameters:
namespace- the namespace to use when register commands- Returns:
- this CommandAPIConfig
-
instance
-