Shopkeepers

Shopkeepers

2M Downloads

Option to ignore the damage value of tools

blablubbabc opened this issue ยท 0 comments

commented

This was basically already requested in the past by this old (and declined) ticket: #165

This was previously declined since it differs from minecraft's trading / item comparison logic, and therefore bares the risk for inconsistencies and glitches/issues and more manual implementation of the trading process.

Since then however a lot of minecraft's trading logic has been reimplemented by the plugin anyways already. So the changes required for this feature might no longer be consider to be as 'major' as they have been back then.

In principal:

  • This would be optional, either globally via a config option, or maybe per-shopkeeper (maybe via toggle-able editor option?).
  • One way to implement it without having to reimplement item data comparison manually could be to duplicate the involved items, reset the damage values and then compare for item equality.
  • However: Since minecraft doesn't 'activate' the trade (inserts the result item in the result slot) for these items (since it doesn't considers them to be matching), the plugin would have to do this manually itself: Detect inventory interactions of the player (what about other plugins automatically inserting items into the inventory for the player? To handle those automation plugins they would need to trigger fake player inventory interaction events for this to properly work.), check if the input items have changed, determine the matching trading recipe and update the item in the result slot.

Open questions: Are there issues with manually insert the result item into the result slot? Minecraft might update the item in the result slot itself under various conditions. This would need to be tested.