Make shop items use json
Closed this issue · 2 comments
SamB440 commented
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
In GitLab by @JordanPlayz158 on Jun 6, 2021, 18:03
mentioned in commit 80219dd