SamB440 / Tale-of-Kingdoms

An adventure of glory in the world of Minecraft - Revival of Tale of Kingdoms mod
GNU General Public License v3.0
16 stars 2 forks source link

Make shop items use json #56

Closed SamB440 closed 2 years ago

SamB440 commented 3 years ago

Currently shop items are all individually defined in class files. This is very messy and is going to become a problem in the future.

It would be nice to store this data in json instead, so it is also modifiable.

I recommend something like the following format:

"BREAD": {
    "cost": 32,
    "name": "Bread" 
  }

Or, you could just have a simple key-value format and generate the name field automatically.

Another consideration to take into account is that the item type will have to be retrieved somehow. Currently it is done like so:

@Override
public Item getItem() {
    return Items.BREAD;
}

Reflection in some way will likely have to be used.

SamB440 commented 3 years ago

mentioned in commit bed17c3225e51e13eed9cb0d60315199b8475dcb

SamB440 commented 3 years ago

In GitLab by @jordanplayz158 on Jun 6, 2021, 18:03

mentioned in commit 80219dd5c249fe51babef8b0a4852a0f14a37c1a