The Aether

The Aether

35M Downloads

Refactor: Move code from being stored directly in event listeners to methods that can be called from event listeners.

bconlon1 opened this issue ยท 1 comments

commented
  • Anything that uses an event as a parameter should probably be switched to instead use values from the event as parameters where necessary. E.g. ZaniteAccessory.
commented

So the idea is to implement an EventHooks class or multiple based on type of events (ClientEvents, WorldEvents, BlockEventHooks, etc)

You should decompose the variables from the event to use only the parameters the code would use, What I think is worth having a discussion over first is if we want to pass ALL methods to the hook so we can future-proof having this data but result in unused parameters. Or we can add parameters as needed but this will require any other modloader forks to re-adapt the same. I'll continue in Discord about this.

Looks like AetherEventHooks exists already though but this isn't the ideal name for it anymore. These methods should be moved into a new class called AetherEventDispatch or another yet descriptive name.