Resource (ACF - BETA) Annotation Command Framework

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

  1. is it really hurting that badly lol?
    • Agree Agree x 1
  2. MiniDigger


    I mean, it would hurt me too to be reminded that I run a 1.8 server in 2019 :ROFLMAO:
    • Like Like x 3
    • Funny Funny x 1
    • Winner Winner x 1
  3. Idm it being there it just fucks with the format of my startup message. I just wanted to be able to change the color
  4. lots of ACF updates tonight.

    - @Default methods now can consume other parameters, a long standing issue thats finally been resolved!
    - @private can now be put on the class or even super class to mark all commands private (doesnt show in tab complete)
    - Per Joo, CatchUnknown can now be in a different class than Default handlers
    - All of the "OnlinePlayer" contexts have been semi-moved to a platform specific package, such as co.aikar.commands.bukkit.context.OnlinePlayer. This was so that you can use multiple ACF modules in the same jar without each ACF domains OnlinePlayer clashing with each other. A deprecated alias is left in the old position to maintain backwards compat, but you should update your import to the new preferred home, especially if you have multiple ACF types in same project. OnlineProxiedPlayer was renamed to OnlinePlayer for consistency for Bungee.

    @Splodgebox I removed that version log line
    • Friendly Friendly x 1
  5. Hey i want my plugin to load the messages for acf from an database...
    Is there any way to insert locates per with you using an FileConfiguration?
  6. Is there a way to change the automatically generated syntax format (and colors) that displays in game when someone types in a command incorrectly?
  7. electronicboy

    IRC Staff

  8. gzx


    Is there a way to have command arguments be positioned between subcommands?

    For example, a command like this:
    Code (Text):
    /foo <parameter> bar
    where bar is a subcommand.

    I've only been able to figure out how to add arguments after all the subcommands, which is quite restricting.
    #310 gzx, Jun 12, 2019
    Last edited: Jun 17, 2019
  9. MiniDigger


    @gzx feature requests go onto github. in fact, there is already a request for your case
    as this is a rather complex feature and aikar is rather busy nowadays, I don't see that request moving forward rather soon, unless somebody steps up and creates a PR (maybe you? :))
  10. Looking to swap over to using ACF - is there any way to make commands that are just /basecommand? I find any option that doesn't involve aliasing a subcommand. I guess I can just make a catch-all base, but it feels a bit silly.

    Edit: Looks like you can use @Default or the alias "__default".
    #313 Jikoo, Jun 17, 2019
    Last edited: Jun 18, 2019
  11. Hello,

    is it possible to somehow load ACF on runtime without shading it into uber JAR?

    Currently I'm loading all needed libs from /lib folder placed on server by adding URLs to ClassLoader on runtime but it clashes with ACF & it's dependency Expiring Map.

    Code (Text):

    java.lang.IllegalAccessError: tried to access class net.jodah.expiringmap.ExpiringMap$ExpiringEntry from class net.jodah.expiringmap.ExpiringMap
        at net.jodah.expiringmap.ExpiringMap.putInternal(
        at net.jodah.expiringmap.ExpiringMap.putIfAbsent(
        at java.util.concurrent.ConcurrentMap.computeIfAbsent(
        at skinsrestorer.shared.utils.acf.ACFPatterns.getPattern(
        at skinsrestorer.shared.utils.acf.ACFUtil.replace(
        at skinsrestorer.shared.utils.acf.ACFUtil.replaceStrings(
        at skinsrestorer.shared.utils.acf.CommandManager.formatMessage(
        at skinsrestorer.shared.utils.acf.CommandManager.sendMessage(
        at skinsrestorer.shared.utils.acf.CommandIssuer.sendMessage(
        at skinsrestorer.shared.utils.acf.CommandIssuer.sendMessage(
        at skinsrestorer.shared.utils.acf.CommandHelpFormatter.printHelpHeader(
        at skinsrestorer.shared.utils.acf.CommandHelpFormatter.showAllResults(
        at skinsrestorer.shared.utils.acf.CommandHelp.showHelp(
        at skinsrestorer.shared.utils.acf.ACFBukkitHelpTopic.<init>(
        at skinsrestorer.shared.utils.acf.BukkitCommandManager.lambda$new$0(
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.enablePlugins(
        at net.minecraft.server.v1_14_R1.MinecraftServer.a(
        at net.minecraft.server.v1_14_R1.DedicatedServer.init(
    It's being used in SkinsRestorer - I've checked, it's the same exact version, but somehow it produces above error... :/
  12. Use Dependency Loader. ;P
  13. U should release this as library each plugin could use on its own. I don't want to add another plugin just for dependency downloading.
  14. Heey, sorry for bumping this. I'm trying to make my own ban system using ACF. What I'm actually trying to do is to pass multiple arguments into one single object (e.g I have this public void onTempban(CommandSender sender, Ban ban) and actually have this much arguments: <player> [-s] <time number><s|m|h|d|w> <reason>). How can I tell ACF to do this, or it is not a feature yet?
  15. simpleauthority


    use a command context and pop all the args you need that make up the Ban object.
  16. I already have a command context resolving it. The problem is that whenever I try to run it, acf says "unknown command".
  17. simpleauthority


    Then you didn't register it properly. Join Aikar's discord and ask for help there.