CivClassic / ItemExchange

ItemExchange is a Minecraft plugin that allows players to make shops to physically buy and sell items. Built for Paper 1.16.5
Other
0 stars 10 forks source link

Modifier refactor #14

Closed Protonull closed 4 years ago

Protonull commented 4 years ago

This relies on the APIs added int this PR

Protonull commented 4 years ago

This PR probably seems like a lot, but most of it cascade. Remember that Map I showed you that mapped 1:1 a class and an instance of that class? Well I refactored that to be less generic based, but it also meant making the modifiers themselves less generic based, so most of the changes to the modifier classes are just changing the signature of the classes.

Additionally, as described in the two commits labelled "config change", there's been two substantial removals from the config, thus also a removal from the config parser and the modifiers that used those config methods... again.. lots of cascade :P

What's the actual takeaway from all these changes?

  1. ItemExchange now works natively with my CustomItems system that's currently in PR

  2. The successful transaction button feature is functional

However there are some consequences to these changes:

  1. The config in the AnsibleSetup will need to be changed to reflect these changes

  2. (POTENTIAL) I did what you said and refactored the IETransactionEvent. You said that it could be removed since the only plugin that used it was JukeAlert and it doesn't anymore, but I still want to emit such an event, so I've instead refactored it. I'm putting this warning here just in case some other plugin also listens for IETransactionEvent.

Basically the PR looks scary but the amount of actual changes in what's being done is quite small. Also, the reason why these commits keep failing is because like with takeaway point one, there are a few calls to new APIs that are currently in PR.