Cleanroom
Cleanroom copied to clipboard
Expand Action(IForgeAction&IForgeArmPose)
expand the EnumAction and ArmPose
but remain the vanillan if.
The Functional Interface
We use functional interface to expand the EnumAction and ArmPose. This design is from the forge hook of EnumEnchantmentType.
Usually, we use EnumHelper to add a enum, this means what we could do is just aload a reference. We could not override it, this is why we use functional interface to expand it.
The Legacy Mods
As far as i know, there are lots of mods have impled the expandation of EnumAction or ArmPose use their own mixin or asm.
To preserve compatibility, I don't remove the original if chain, although using polymorphism would look nicer now.
Looks good, please wait for Rong