Closed SamB440 closed 2 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.
mentioned in commit bed17c3225e51e13eed9cb0d60315199b8475dcb
In GitLab by @jordanplayz158 on Jun 6, 2021, 18:03
mentioned in commit 80219dd5c249fe51babef8b0a4852a0f14a37c1a
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:
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:
Reflection in some way will likely have to be used.