-
-
Notifications
You must be signed in to change notification settings - Fork 147
Using ACF
adabugra edited this page Feb 25, 2024
·
18 revisions
See Maven, Gradle, or you can find artifacts here:
Or manual: https://repo.aikar.co/content/groups/aikar/co/aikar/
This part is platform specific. Use the command manager that represents your platform.
Bukkit:
BukkitCommandManager manager = new BukkitCommandManager(yourBukkitPlugin);
Paper (Recommended over Bukkit):
- Using the Paper Command Manager does NOT make your plugin require Paper. It simply lets it take advantage of Paper specific features if available, such as Asynchronous Tab Completions
- Paper specific improvements will be added in the future as potential is found.
- Server owners are STRONGLY encouraged to use Paper instead of Spigot or CraftBukkit, as it is a massive improvement to the server software.
PaperCommandManager manager = new PaperCommandManager(yourBukkitPlugin);
Bungee:
BungeeCommandManager manager = new BungeeCommandManager(yourBungeePlugin);
Sponge:
SpongeCommandManager manager = new SpongeCommandManager(yourSpongePlugin);
Velocity:
VelocityCommandManager manager = new VelocityCommandManager(yourProxy, yourVelocityPlugin);
First you need to create a class that extends BaseCommand
, then register that command with the manager
manager.registerCommand(new MyCommand());
If you need your plugin instance, pass it to your commands constructor using dependency injection:
manager.registerCommand(new MyCommand(myPlugin));
However if your needs are simple, ACF provides a minimal dependency injections system to be able to access your plugin object through dependency annotations too.
See Wiki Home for links to the other guides, but here is some important ones: