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 Details

    • CommandAPIBukkitConfig

      public CommandAPIBukkitConfig(String pluginName)
      Creates a new CommandAPIBukkitConfig object. Variables in this constructor are required to load the CommandAPI on Bukkit properly.
      Parameters:
      pluginName - The name of the JavaPlugin that is loading the CommandAPI
  • Method Details

    • fallbackToLatestNMS

      public T fallbackToLatestNMS(boolean 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

      public T addSkipSenderProxy(String... names)
    • addSkipSenderProxy

      public T addSkipSenderProxy(List<String> names)
    • 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.class
      nbtContainerConstructor - a function that takes an Object (NMS NBTTagCompound) and returns an instance of the provided NBT compound container. For example, NBTContainer::new.
      Returns:
      this CommandAPIConfig
    • setNamespace

      public T setNamespace(String namespace)
      Sets the default namespace to use when register commands

      This namespace can't be null or empty and has to match the regex: [0-9a-z_.-]+

      Overrides:
      setNamespace in class CommandAPIConfig<T extends CommandAPIBukkitConfig<T>>
      Parameters:
      namespace - the namespace to use when register commands
      Returns:
      this CommandAPIConfig
    • instance

      public abstract T instance()