Resource (ACF - BETA) Annotation Command Framework

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

  1. Why tf would you write new software in cobol... *SIGH* Just let it die.. ffs
     
  2. Okay, I do actually want Kotlin, but I'd much rather have it in its own framework.
    Anyways, so far I've had no problems without it, and I've done two commands in it, one with varargs and other with subcommands. It works amazing!
     
  3. Kotlin Annotation usage is exactly the same. And that's primarily what the implementation of ACF is, adding a bunch of annotations and a few .register calls.

    I see no benefits to a Kotlin version other than Kotlin devs helping out, and I've seen no one promise to help work on the project A LOT to make it worth that =P


    But back on topic -- has anyone migrated to 0.5.0? I think I'm going to release it today, but kind of wanting to break the completion signature

    It's currently (sender, config, input, c)

    The first 3 are avail under c, and I would like to drop them and keep it consistently c -> { } like Context Resolvers

    This would mean needing to update all of your completion handlers.

    This would mean removing them from the signature and adding like CommandSender sender = c.getSender(); to the method to add it back.

    Thoughts?
     
  4. Other than a complete rewrite to reduce the code base size and utilize the functionality that kotlin has that java does not, it adds no purpose to have a partial implementation or addon in kotlin.

    Though whoever said kotlin is shit is stupid. Cuz it adds some nice functionality to the jvm for people who don't want to have to stray far from java with something such as scala.
     
  5. I think I'm gonna use this, seems cool







    Oh I need maven well rip that idea
     
  6. MiniDigger

    Supporter

    time to learn maven or gradle :D
    its really not hard
     
  7. Whenever I try it just ends up with me semi-raging because something doesnt work, any good tutorial?
     
  8. Gradle easier than maven. Good tutorial on official website.
     
  9. Feel free to jump on IRC and plenty of people can help.
    summary: move your code into src/main/java/ and resources into src/main/resources and do a little dance with a build config, make a little love, get compiling tonight.
     
  10. bump for awesome commands!
    ACF support for Bungee has now just been merged to the WIP modular branch!
     
  11. It's out! its out!

    ACF 0.5.0 was merged to master tonight.
    This means there will be no more API breaks in 0.5.0, and it is stable to start your migration if you have not already.

    This update will take some time, as lots of things changed.

    For a guide on migrating, please see: https://github.com/aikar/commands/wiki/Migrating-from-0.4.0-to-0.5.0

    BungeeCord and Sponge Support is now included! So if your plugin supports multiple platforms, you can use ACF everywhere :)

    No more updates will be done for 0.4.0, so please update ASAP.

    Enjoy!
     
  12. No you don't. Gradle is supported, and a link is provided for people who use other bad build processes to directly download the .jar files too.
    But if you are using Ant/IDE compiler, you realllllly need to fix that.
     
    • Agree Agree x 1
  13. Work on I18N (The ability to change the messages used by ACF and to make them translatable and give your players different language options) was done last night! Major progress made :)

    Work will likely continue tonight on it on my live stream.

    EDIT: 1/6/2018 - The work discussed here has been implemented!
     
    #133 Aikar, Jun 27, 2017
    Last edited: Jan 6, 2018
  14. Let's jump to questions over here.

    Current version is 0.5.0-SNAPSHOT, you need group ID co.aikar and artifact ID acf-bukkit

    And on the i18n/locales work - API is coming along nice, looking really good! Almost near release.
     
  15. Will your i18n framework support spigot chat components?
     
  16. MiniDigger

    Supporter

    Iirc he said no because he wants to keep it universal and don't bind it to spigot or smth.
    I mean, I guess you could let acf translate json and then send that to the player yourself
     
  17. Nothing would stop you from using the i18n tables in Chat Components

    something like
    Code (Java):

    new TextComponent(i18n(player, MessageKeys.FOO, "{foo}", foo))
        .hover(i18n(player, MessageKeys.FOO_HOVER, "{foo}", foo));
     
    I still need to add i18n util method.
     
    • Like Like x 2
  18. Big news! I18N has been deployed to my repo! This is still under version 0.5.0 as no API had to break.

    So any future compiles will be including the reworked I18N code.

    The API's are currently still locked, as some things need to be finished up there, but if you need to adjust any of the language in ACF simply add a new file to your src/main/resources/ folder named
    Code (Text):
    acf-YourPluginName_en.properties
    And it will be automatically loaded.
    Then you may override any language key defined in
    https://github.com/aikar/commands/blob/master/languages/core/acf-core_en.properties
    https://github.com/aikar/commands/blob/master/languages/minecraft/acf-minecraft_en.properties

    (You can put overrides to both of these files into your same file, I have them broken up because they are shared between platforms)

    Supporting other than English will have to wait until I finalize the API, but you could use the english language files and write other languages in it for now if you need.

    Also, a new formatting system is in place. Use <c#>XXXX</c#> format to use alternate colors. Currently, only 3 colors are registered for each message type, so only use <c1>, <c2> and <c3>.

    These colors will be customizable once the Locales API is unlocked.


    Sponge Support should also now be good to go, if you also support Sponge with your plugin.

    Lots of code changed, so please report bugs to me ASAP :)
     
    • Like Like x 1
  19. Bergslagen

    Bergslagen Previously FooBarSak

    Is it possible to edit a message without a language file, like change the message for a language manually on plugin startup?
     
  20. Once the API is unlocked, yes.

    But what's wrong with language file? Does it need to be dynamic (That's the only case I can see)?
     

Share This Page