Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

YAML/JSON writer/reader

Comments in 'Tools' started by PEMapModder, Jun 13, 2014.

?

Do you like this?

  1. Yes

    100.0%
  2. No

    0 vote(s)
    0.0%
  1. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I have just finished this script to help testing YAML and JSON files in resources.
    Usage:
    Download the PHP file in the gist into a new folder in your device. Then copy your bin/ folder in PocketMine-MP into the new folder and run the PHP file via the PHP.
    command /yaml [-e] file name.yml can be used to read a YAML file and echo the PHP code that contains the same value on console. If you have -e added, you can export the file into output.php.
    command /json [-e] file name.json is the same except it is for JSON.
    command /writeyaml <file> <-key value value value>... can be used to instantiate a YAML file at <file> that represents the keys and values. Currently this command only supports writing YAML files with no nested items and with no keys of multiple words (only one word).

    Hope this tool helps (especially in plugin development)!

    To output this file at plugin.yml:
    Code:
    name: Testing Plugin
    author: PEMapModder
    version: beta 1.0.0
    api: [1.0.0]
    description: Hello world this is a testing YAML file
    
    You should enter this on console:
    Code:
    writeyaml plugin.yml -name Testing Plugin -author PEMapModder -version beta 1.0.0 -api [1.0.0] -description Hello world this is a testing YAML file
    

    If you are using Windows, download start.cmd so that you don't need to run the script in command prompt every time :) but this batch file is untested ;)
  2. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    Nice tool.
  3. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    One thing, I don't get what this would be used for...
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    For those who are not sure about YAML syntax, like me.
    jython234 and iJoshuaHD like this.

Share This Page

Advertisement