Hebbinkpro / MagicCrates

Add customizable crates to your server
GNU General Public License v3.0
4 stars 6 forks source link

Change crate type creation to JSON #24

Closed Hebbinkpro closed 10 months ago

Hebbinkpro commented 10 months ago

Currently crate types are created in the config.yml file. While YAML is a great file type for config files, it isn't for large data structures because of the indentation. To resolve the unclarity of using YAML, crate type creation will move to JSON.

So for example, the yaml file below

types:
  common:
    name: Common Crate
    item: 
        id: minecraft:diamond

Will change into the following

{
    "common": {
        "name": "Common Crate",
        "item": {
            "id": "minecraft:diamond"
        }
    }
}

I hope this change will resolve some of the issues which can occur while creating crates.

To make this change not break servers that already have set up their crates properly, all crates in the config.yml will be converted to JSON automatically.