Developers! Need your assistance! YML

Status
This thread has been locked.

Bryce

Senior Java & Full-Stack Developer
Supreme
Feedback score
18
Posts
678
Reactions
934
Resources
19
Hey there!

Most of you may know me for my projects GUIShop, AntiBot, Spells and even ShulkerBox. Anyways. I have quite a bit of experience with YML syntax however this one's got me stumped. I need help identifying each object inside this YML. The reason I am requesting help, is I am updating GUIShopPlus, however the reading of the config is completely different than reading it. (Hopefully someone understands what i'm talking about). I have done some digging in the SnakeYML docs but no luck >.< .

YML:
Code:
Raiding:
  '1':
  - name: '&3Creeper &4Egg'
  - slot: 0
  - id: '383:50'
  - buy-price: 7500
  '2':
  - slot: 1
  - id: '46'
  - buy-price: 100
  '3':
  - slot: 2
  - id: '356'
  - buy-price: 200
  '4':
  - slot: 3
  - id: '404'
  - buy-price: 100

What I've tried:

So, looking at the YML, at first this is what I observed.

Each item is a list. However, the list's key, is a string? Tried removing the quotes to see if the object changed, it did. This must be a specific list. Maybe not a list at all (my assumption)?

The list is NOT a string list, or general list. It appears to be a list of keys, and values. I have tried using a list of maps, didnt appear to work either.

Each item is clearly chained. These are not independent values e.g (first.second.value). You are required to grab the list, and iterate through the values to read each one.

Here is my code I use to read the config: GitHub

You can see, I read the config quite manually. I am not using conventional methods to read this config as I cant figure out what the hell is inside this yaml! I would like to update my reading method to use proper, conventional ways inside snakeyml, as the yaml DOES come up as valid when tested. If I can figure out how to do this, I can easily port the method over for saving as well. If someone can identify what these lists/maps/objects are, and how they're laid out, I would greatly appreciate this!
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Bryce

Senior Java & Full-Stack Developer
Supreme
Feedback score
18
Posts
678
Reactions
934
Resources
19
Maybe try using Justis's improvement of YAML called MYML.


Its not the reading or setting I'm having difficulty with, infact I quite like SnakeYML, and its already built into bukkit. After all, quite a few thousand people use this plugin, and I would rather stick to things I know work. I just need to identify what the hell is inside my config's Ahahaha. I feel so embarrased as I wrote them myself, and yet I cant identify what I wrote. I formatted it so its easier on the eyes tbh. You wouldn't believe what some people have trouble with when configuring. I formatted my configs like this to be "noob friendly"[DOUBLEPOST=1493407641][/DOUBLEPOST]Acutally, thanks to Croc he gave me an idea in live chat.

He said "Why dont you convert the YML to a json object". This gave me the idea to throw my yaml into a converter, and read the json which is 10x easier.

bf56c152db780136a306e7b38cfaf644.png


This shows, I have the following:

JsonObject:
-JsonList
--object
--object
--object
-JsonList
--object
--object
blah blah

Using this knowlege I should be able to figure out how to read the yaml once and for all!

Thanks Croc for this pointer that has possibly led to the solution!
 
Last edited:

Thom

Setup Specialist
Supreme
Feedback score
22
Posts
449
Reactions
316
Resources
0
"Developers! Need your assistance! YML"
 
Status
This thread has been locked.
Top