mrbuilder1961 / ChatPatches

A Minecraft client-side mod that touches up Minecraft's mundane chat, with configurability in mind!
GNU Lesser General Public License v3.0
44 stars 16 forks source link

Change duplicate counter implementation #132

Closed JustAlittleWolf closed 8 months ago

JustAlittleWolf commented 8 months ago

This changes the implementation of the addCounter() method from an @injection in the head, to a @modifyvariable method. As the code already modifies the incoming text message variable in the modifyMessage() method. The primary objective of this change is to improve mod compatibility, as unexpected things happened with the old implementaiton where it would be recurvise (or not, I'm not sure?) and cause some issues.

The new method makes the addcounter() method a unique one that returns a the modified text with the changed message. it is then called in modifyMessage(), just before that method returns the modified message. This should lead to better compatibility and it is also simpler to follow the flow of the program.

JustAlittleWolf commented 8 months ago

I have tested this and it works without any problems :)