The major aim was to eliminate usage of the antipattern where the vanilla method is replicated with a cancellable @Inject all to insert a small section of mod code.
This is a very problematic way to implement functionality because:
Any injected handlers after a handler using this pattern will silently fail to run
It's hard to maintain. Every MC version update requires re-copying and re-adapting the code to cancellable @Inject
It's legally dubious at best. Minecraft's code is proprietary, so avoid copying it if at all possible.
Best practices implemented:
Handler methods private when possible (standard Java best practice to minimise access levels)
Handler method names describe their purpose not what they inject into (more readable and debuggable)
Handler method names prefixed with mod ID (Easier identification of mods that own handlers when looking at stacktraces)
There's are also more specific tweaks and details that I've commented on in the code, or in the web diffs.
If you're a Discord user, MMD will provide help with Mojmap mixins. Unfortunately the Fabric Discord does not, due to Yarn's cleanroom requirements.
The major aim was to eliminate usage of the antipattern where the vanilla method is replicated with a cancellable
@Inject
all to insert a small section of mod code.This is a very problematic way to implement functionality because:
@Inject
Best practices implemented:
There's are also more specific tweaks and details that I've commented on in the code, or in the web diffs.
If you're a Discord user, MMD will provide help with Mojmap mixins. Unfortunately the Fabric Discord does not, due to Yarn's cleanroom requirements.