team-abnormals / blueprint

Library that implements the framework of all Abnormals mods
https://www.curseforge.com/minecraft/mc-mods/blueprint
Other
111 stars 34 forks source link

[1.16.5] Added Chlorine Compatibility #97

Closed jacksonhardaway closed 3 years ago

jacksonhardaway commented 3 years ago

This PR adds compatibility for Chlorine which fixes it from crashing and still retains AnimateTickEvent and AnimateFluidTickEvent.

I've added compatibility by moving the animateTick redirects into two mixins, ClientWorldVanillaMixin and ClientWorldChlorineMixin, which target the correct animateTick methods and then using a mixin plugin, I've loaded one or the other based on if Chlorine's main class is available (read comment in ACMixinPlugin for more info).

Now there are some side-effects to this, if Chlorine were to remove or rename their methods (performBlockDisplayTick and performFluidDisplayTick) it'll start crashing again as I have no way of checking the version of Chlorine. Though I highly doubt these methods will change at all and this is better than it crashing currently.

Obviously this isn't the greatest fix, preferably it should be done on Chlorine's side, but this is better than nothing for the moment.

Fixes #82

jacksonhardaway commented 3 years ago

This should probably be done on Chlorine's side instead. It's a pretty bad fix that can cause more issues.