[1.20.1 Fabric] Tweakeroo shouldn't prepend timestamps onto messages if `refresh` is true
caoimhebyrne opened this issue ยท 3 comments
At the minute, Tweakeroo adds timestamps to any message that's sent, even ones that are sent during the refresh
period.
This refresh period only re-sends messages which have already been sent, and is used by some mods (like mine, CompactChat) to ensure that the chat view is up-to-date with removed messages.
The refresh()
function's definition in ChatHud
, as of 1.20.1:
Tweakeroo's injection point:
tweakeroo/src/main/java/fi/dy/masa/tweakeroo/mixin/MixinChatHud.java
Lines 19 to 22 in ae45538
As you can see above, Twaekeroo doesn't take the refresh
parameter at the end into account, meaning that it just adds timestamps to all messages.
This results with timestamps being falsely-updated when refresh()
is called (the original message's creation date should stay intact), and it also gets duplicated in certain instances.
For reference, this is my mod's injection point (albeit slightly outdated, I'm updating the priority to 9999
so that I can add support for Tweakeroo, but this issue is also blocking that):
I'll make a PR for this issue, but if there's a reason that I shouldn't do it, let me know
In general my client mods' code has been rotting away for several major MC releases by now. The mod updates to many of the recent MC versions have been PR'd in by others. I know there are several features and code areas that haven't been properly updated to all the vanilla changes and new features. I intend to go through and clean up and rewrite where needed everything once I start porting the newer development code from 1.12.2 to the later versions. For now the mods are basically in least effort life support mode, to remain mostly usable for players. So yes PR away.
@maruohon Awesome! I've opened a PR. This should also fix an issue that occurs when a message has been removed by the server (I've never seen that happen though, it's just in the code)