Code change request: annotate the entire `ItemRenderWeaponBase`, instead of each weapon individually
Darek505 opened this issue · 2 comments
Title, Indeed, why not just annotate the entire ItemRenderWeaponBase
in MixinItemRenderWeaponBase
?
Right now we're annotating each weapon individually, which means that when bob makes new weapons, they'll still render the old way unless you just add a mixin for it and include that annotation.
If you annotate the entire ItemRenderWeaponBase
, then any weapon that extends that class (which is all weapons, since they all extend the base class) will also have that annotation.
That way you don't even have to do anything, since all weapons will inherit that annotation themselves, and the fix will apply to them.
I thought so at first, but then I came to another way as you can see.
The thing is: the annotation, as such, is a kind of confirmation that the weapon is fully tested, and therefore fixed correctly.
If we blindly give an annotation to all weapons ItemRenderWeaponBase
, then it will use our fix immediately, without checking how this fix will affect it.
Take a look for example at MixinItemRenderAtlas
, MixinItemRenderDANI
, MixinItemRenderHenry
, MixinItemRenderMaresleg
, they all have the fixAfterSmoke
method. The thing is that some weapons run the smoke render AFTER the weapon texture is applied, but BEFORE the weapon itself is rendered. Because of this, the weapon texture becomes simply white, due to the specifics of the fix. Thus, some weapons require a so-called post-fix. Therefore, it is important to set the annotation manually to confirm that the weapon works correctly, and if not, then fix it in the same mixin where we give the annotation.
Plus, this method:
Here, we manually set turnMagnitude, depending on the weapon. Accordingly, we already need to get into the render code, at least because we need to take the value for turnMagnitude from there, so in any case, we will have to do something manually.