Chat Patches

Chat Patches

2M Downloads

ClassCastException when serializing chat log with Skyblocker's custom click events - 8.0-alpha.5 - 1.21.8 Fabric

Closed this issue · 6 comments

commented

Description

ChatPatches throws an error with a ClassCastException when attempting to save/serialize chat logs while running alongside the Skyblocker mod. The error occurs because Skyblocker uses a custom click event implementation (tech.thatgravyboat.skyblockapi.utils.text.RunnableClickEvent) that ChatPatches cannot serialize using Minecraft's standard codec system.

The error prevents chat logs from being saved and produces the following error:

[Chat Patches/ERROR]: [ChatLog.serialize] An unexpected error occurred while trying to save:
java.lang.ClassCastException: class tech.thatgravyboat.skyblockapi.utils.text.RunnableClickEvent cannot be cast to class net.minecraft.class_2558$class_10607

How to reproduce

  1. Install ChatPatches mod
  2. Install Skyblocker mod
  3. Join the Hypixel Skyblock server
  4. Receive chat messages that contain Skyblocker's custom click events (common in Skyblock menus and interactions)
  5. Wait for ChatPatches to attempt to serialize/save the chat log
  6. Observe the ClassCastException error in the logs and chat log failing to save

Expected result

ChatPatches should gracefully handle custom click event types from other mods by:

  • Catching the ClassCastException and logging a warning instead of an error
  • Skipping or sanitizing incompatible components during serialization
  • Successfully saving the rest of the chat log even when encountering custom components

Log file link

https://mclo.gs/f9QqLB8

Specs and Details

Required information:

  • Computer OS: Windows 11
  • Minecraft version: 1.21.8
  • ChatPatches version: 8.0-alpha.5

Additional mods causing the issue:

  • Skyblocker: 5.8.0
commented

thanks for the report. i'm surprised the custom implementation isn't registered within the codec, i'll have to ask the Skyblocker devs about that. the problem with it not being registered is i'd need to mixin register it myself, which is almost certainly going to break things if I do it. i'm sure theres some transformer i can apply to fix it, but easier for them to do than me.

also, i've weirdly not been able to find RunnableClickEvent in the mod's source code, and the package suggests its from an older version - but other lines in the log suggest it's from this mod, so not really sure what's going on there.

commented

actually, if you could open a report on their repository and link back to this one that'd be great - then i can communicate w the devs in a single place

commented

actually, if you could open a report on their repository and link back to this one that'd be great - then i can communicate w the devs in a single place

done

commented

also, i've weirdly not been able to find RunnableClickEvent in the mod's source code, and the package suggests its from an older version - but other lines in the log suggest it's from this mod, so not really sure what's going on there.

The mod that causes this actually isn't skyblocker but SkyblockAPI, I'm one of the maintainers of that mod, we currently have already fixed the issue (SkyblockAPI/SkyblockAPI#258), and are trying to publish a release in the next day or two!

commented

Hai, just wanna give a small followup on this, we just released a new version of our mod, so this should hopefully be resolved!

commented

awesome, thanks so much! seems like chat patches was just experiencing a side effect then. we appreciate the speedy response :D

(closed as invalid - not a chat patches issue)