Do braces belong to the YML Syntax? like it used below? Yes? How to use them like here. PHP: min: {x: 275.0, y: 48.0, z: -92.0}max: {x: 474.0, y: 98.0, z: 65.0} This looks much smoother, for sure if I got 50-300 entries. But if this accomplished by String Regex/Split than it's not my preference. I use normally PHP: min: x: 43 y: 38 z: 3 max: x: 39 y: 35 z: 7 Thanks in advance. Zanax Source: (Braces part) http://dev.bukkit.org/bukkit-plugins/simple-region-market/pages/tutorials/
iZanax JSON is a subset of YAML so yes braces can be used. So valid JSON like this Code: '["foo", {"bar":["baz", "kwa", 1.0, 2]}]' Could be written in YAML as this: Code: - foo - bar: - baz - kwa - 1.0 - 2
Drew1080 Thanks a lot! I do have a question about setting the value in this format Normal approach ConfigurationSection v1Section = keySection.getConfigurationSection("v1"); v1Section.set("x", 1); v1Section.set("y", 1); v1Section.set("z", 1); But how do u make it in the bracket format? : ) Thanks in advance
iZanax Those are braces or curly brackets. Brackets are these [ and ]. I believe that YAML supports brackets for arrays (correct me if I'm wrong)
That's true. That is why you can actually use Code: authors: [x,Troll,x,Dude,x] in your plugin.yml for example. It creates an array of strings.
xTrollxDudex I've changed it to Braces ^^ However, I do have a strange thing that occurs. min: {x: 275.0, y: 48.0, z: -92.0} This will get acceped by the YML under the ConfigurationSection, but it will change it back to the extended version without braces. So is there any other approaches that will keep the braces format? Code:java Vector min = new Vector(minSection.getDouble("x"), minSection.getDouble("y"), minSection.getDouble("z")); Thanks in advance.
iZanax You'd have to use brackets [ and ] in order to do that. Using braces { and } defaults to a sectional node in SnakeYAMl and will auto format it for you.
xTrollxDudex Okay, SnakeYAML will auto format it back to without braces. min: [x: 275.0, y: 48.0, z: -92.0] I've tried the brackets, but this is no ConfigurationSection and won't work with the current settings. What are u suggesting? I preferably wont want to use regex/split
xTrollxDudex ConfigurationSection min; min.set("x", 275); min.set("y", 48); min.set("z", -92); Im setting each xyz individually as Double.