EssentialsX

EssentialsX

2M Downloads

Overhaul items.csv structure in preparation for 1.13 breaking changes.

dscalzi opened this issue ยท 1 comments

commented

Originally mentioned in #1448

I'm sure you guys have heard that in 1.13 items no longer have data values, which will break this file big-time. I've been working on some solutions to this issue but I'm not entirely sure of the best way to approach it. An idea that I'm liking a lot is converting this file to json-format. Example entries:

Potion:

{
      "materialSpigot": "SPLASH_POTION",
      "legacyID": "438",
      "legacyData": "16452",
      "versions": [
        "1.12"
      ],
      "potionMeta": {
        "effect": "POISON",
        "extended": true,
        "upgraded": false
      },
      "aliases": [
        "splashpoisonextendedpotion",
        "splashacidextendedpotion",
        "splashpoisonexpotion",
        "splashacidexpotion",
        "splashpoisonextendedpot",
        "splashacidextendedpot",
        "splashpoisonexpot",
        "splashacidexpot",
        "splpoisonextendedpotion",
        "splacidextendedpotion",
        "splpoisonexpotion",
        "splacidexpotion",
        "splpoisonextendedpot",
        "splacidextendedpot",
        "splpoisonexpot",
        "splacidexpot",
        "sppepot"
      ]
}

Regular Block:

{
      "materialSpigot": "OBSIDIAN",
      "legacyID": "49",
      "legacyData": "0",
      "versions": [
        "1.12"
      ],
      "aliases": [
        "obsidian",
        "obsi",
        "obby"
      ]
}

Tipped Arrow

{
      "materialSpigot": "TIPPED_ARROW",
      "legacyID": "440",
      "legacyData": "0",
      "versions": [
        "1.12"
      ],
      "potionMeta": {
        "effect": "NIGHT_VISION",
        "extended": false,
        "upgraded": false
      },
      "aliases": [
        "arrownightvision",
        "nightvisionarrow",
        "arrownv",
        "nvarrow"
      ]
 }

This format would take up more lines/filesize, however as a while I believe it's better than csv. Mojang is moving further away from numeric block data and more towards NBT states, which can be more easily stored in json format.

This format could also support different versions per block. I haven't finalized how that could function, however there are several ways. The first is included in the json snippets above. We include a versions array which will store the versions that this block is present on. This can become redundant, however.

Another option is to include a since parameter which will record the first version this block appeared in. If the block was removed there can be an additional parameter, maybe until, where we record the last version this block appeared in. If the block's data has changed, we could mark the old data using this versioning syntax, and create a new entry for it. An example of this would be like what happened with the different wood style doors in 1.12.

I've already written an ad hoc script to convert the existing data into this format, the only thing which would need to be written is a merge script to merge older item data. Let me know what you think.

commented

Closing in favour of #1906.