NexAdn / UnitedShops

Bukkit Admin Shop plugin
GNU General Public License v3.0
3 stars 2 forks source link

Same names without same damage #16

Closed Godivctor closed 6 years ago

Godivctor commented 6 years ago

When set to buy two materials with the same name but without same damage the shop only show to buy the material with higher damage. Example:

STONE:
   buy: 10
   sell: 5
   damage: 0
STONE:
   buy: 10
   sell: 5
   damage: 1

Only the STONE with damage 1 show to buy.

NexAdn commented 6 years ago

This could need a rewrite of the config.yml structure, so it could take a bit longer than expected.

NexAdn commented 6 years ago

First of all, sorry that it took so long. I had more important things to do lately and this is not the only repo I maintain.

This commit should resolve this issue. I figured out a way to make the new configuration format backwards-compatible and changing to the new format is only required (though always recommended) when using the same material type with various damage values. I also updated the default config.yml to reflect these changes:

https://github.com/NexAdn/unitedshops/blob/756176db722425d853067dc5a472f4e77393b34e/src/main/resources/config.yml#L25-L39