Resource (ACF - BETA) Annotation Command Framework

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

  1. Opportunity to learn :) It's actually not that advanced. It's powerful, but not really that complex.

    Use this as an opportunity to learn. Study what's going on and when you figure it out, you've learned something!
     
  2. Well, I really like this idea. It makes everything easier for the developer.
    But, I have a question...

    Some time ago we heard that Minecraft will be getting a command syntax stuff on chat.
    Will you update ACF to support that ?

    (Sorry if this has been asked before, but I don't follow this thread)
     
  3. Yes, the plan is for ACF to implement the 1.13 Command Spec to the best of its ability when ran on 1.13+ servers.

    So you can use ACF and the goal is that ACF will translate its state into the respective state.

    Also, note that 1.13's command is about client UX for syntax/completions, and not about server side utility of command management, so its unlikely to ever be a 'replacement' to ACF (plus, ACF will let you still support older MC versions :))
     
    • Like Like x 1
  4. I got a stupid idea for ACF.
    When 1.13's command syntax stuff is available to the public, you could try to bring that feature to legacy servers(1.13-). You could try to detect when a player tab-completes a command and *maybe* send the syntax to the client using the action bar.

    Sorry if this idea seems stupid...
     
  5. Maybe in future there would be more extendable capabilities in the core that users can extend, then you could implement such an idea, but i dont see that being in ACF itself.
     
    • Friendly Friendly x 1
  6. Hi, it's me again, how is @ Default supposed to work?

    I have tried this signature
    Code (Java):
    public void onTestCommand(CommandSender sender, @Default(1) Integer number)
    but I get this error:

    upload_2017-8-27_21-53-58.png
     
  7. @Default("1") would parse it as an int of 1.
     
  8. electronicboy

    IRC Staff

    Just played with ACF last night after being one of the few people who was asking him to make the framework public (oops), in Kotlin you will need to write a few context resolvers for the Kotlin objects (not all that hard as you can basically just grab them from inside ACF), however; my one concern is a replacement for Player[], My only current idea would be to create a small implementation of List or something that will try to provide a means to pull out players unless somebody knows a way to deal with this in Kotlin nicely
     
  9. OnlinePlayer is suppose to be used for any OTHER player lookup. Player itself is for the sender.

    OnlinePlayer[] already exists as a context.
     
  10. bump!
     
    • Like Like x 1

Share This Page