Resource (ACF - BETA) Annotation Command Framework

Discussion in 'Spigot Plugin Development' started by Aikar, Apr 19, 2017.

  1. Thing is that he banned me... idk why...
    Whatever, I've fixed it by adding String[] args to my execution method so acf thinks its not only 1 argument.
    • Funny Funny x 1
  2. MiniDigger


    Great news guys, @ItsMeGlare (and others) pushed me hard enough to go finish the brigadier integration!
    With a little bit help from the guys over at paper (well, aikar did the changes), we now have an easy way to register stuff into brigadier, making my life a whole lot easier.

    Basically, you know get fancy client side validation suggestions:

    This also implements perm checking for sub commands, so clients dont see subcommands in tab completion they dont have access too

    all you need to do is adding these two lines of code to your command registration code (onEnable)
    Code (Java):
     // 10: (optionally enable brigadier integration, paper only)
    new PaperBrigadierManager(this, commandManager);
    (if you want to support spigot with your plugin, you can only call this if the server uses paper)

    once the following PRs are merged (hopefully later today), you can all try it out. any feedback is appreciated, especially if you can run this on a plugin with a heap ton of nested subcommands with permissions and tons of arguments

    Paper PR:
    • Like Like x 2
  3. we will make the api safely enable with just the unstable line, wont need the new Paper yourself, and it only engage on paper if its supported
    • Like Like x 1
  4. About a year ago I switched to ACF. One of the best decisions I've ever made. I've rewritten my commands under ACF probably 4 times now but here are the results of the initial change.

    • Like Like x 1
    • Agree Agree x 1
  5. I love this stuff. Makes my life so easy :love:
  6. Hey, is there a way I can use this in order to make commands from a config file?
    I'm looking to switch my plugin Emotes Pro over to this library, but one of the key parts of that plugin is that when you create an emote it gives you a command for it. At the moment I'm extending Command and it's an absolute mess. I basically want to be able to go through a list in a config, and create a command for each item in the emote list. From the way it looks I don't see it working, but would love some insight.
  7. simpleauthority


    You can extend BaseCommand and call its constructor (with super) to declare the command name and then continue on from there. I do it here for dynamic channel names as commands:

    There are also CommandReplacements, which I believe are the "proper" way to do it.
    #327 simpleauthority, Oct 6, 2020
    Last edited: Oct 6, 2020