[LIB] MCML - Minecraft Markup Language

Discussion in 'Resources' started by Stealth2800, Jun 24, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Stealth2800

    Why bother writing long complex JSON text for Minecraft when you could just use simple text syntax?

    In many of my plugins, I offer a 'messages.yml' file that allows users to modify plugin messages to their liking. However, there was no way for those messages to include the hoverable and clickable text that Minecraft began to offer in 1.7. To resolve this, I created MCML to make it easy to create these new messages.

    [​IMG]

    MCML is, in a way, an addon to Fanciful by mkremins. Behind the scenes, it translates text into Fanciful's 'FancyMessage' class.


    I still have more features planned for MCML, some of which are listed below. Feel free to leave suggestions in the comments!
    • Ability to enter items for the item hover event as raw JSON
    • Way to convert messages to a plaintext format that can be sent to the console (as the hovering/clicking is only available for in-game players).
    MCML's source code is available on GitHub, feel free to take a look and contribute!

    If you find any issues, you are welcome to post them here but the preferred way to notify me about them is via the issue tracker for the project on GitHub.

    And of course, documentation is also available on GitHub.
     
    Vexil, Phasesaber, Goblom and 4 others like this.
  2. Offline

    LordVakar

    Whoaaaa
    I'm definitely going to use this..
    How did I not think of making a system like this before.
     
  3. Offline

    Wizehh

    Wow.. this is great. Thank you for this!
     
  4. Offline

    Not2EXceL

    Y u no regex?

    Also why the hell are you using labels and goto continue statements? You can easily refactor that function to do without. but if you absolutely must, make it all CAPITALS as that causes them to be actually noticeable.

    Also when you are using regex. (through the use of String#matches(String) as it appears), please precompile the patterns as repetitive calls to String#matches(String) is significantly less efficient due to the pattern compilation overhead.
     
    Stealth2800 likes this.
  5. Offline

    Stealth2800

    Not2EXceL I have very little experience with regex so I appreciate the suggestions regarding it, I'll try modifying the method with it in mind.
     
  6. Offline

    Not2EXceL

    Stealth2800
    So for your parsing of the events. you use something like
    if(!rawText.matches("\\[(url|cmd|scmd):(.+)\\]")){However, you should be using this, as this is a library and you don't know how often your end users will be parsing the messages. Whether that be once on load, or ever time they want to send a message.
    [​IMG]
     
  7. Offline

    Phasesaber

    Looks awesome! I can't wait to use it!
     
Thread Status:
Not open for further replies.

Share This Page