First-person Model (Forge/Fabric)

First-person Model (Forge/Fabric)

4M Downloads

Disconnect with Bewitchment due to an unsafe cast

CammiePone opened this issue ยท 6 comments

commented

This shows up in the logs when you die and have the latest version of Bewitchment and First Person Model installed together. As far as I can tell, you're doing an unsafe cast here, just assuming the Object in the BiConsumer will always be a byte.

image

What ends up happening is the game disconnects you from the internal server, which is better than a full on crash, but still a bit of a problem.

commented

Huh, why the hell does that mod modify vanilla packets in that way... Or maybe the packet id shifts when the mod is installed? Either way, I'll look into it.

commented

I don't believe it modifies vanilla packets at all. None of its mixins target packets. I'd guess maybe a packet ID shift, in which case it may be a Fabric issue? It uses the method Fabric provides for packets.

commented

https://wiki.vg/Entity_metadata#Player Well a metadata packet for a player entity with id 16 is a byte. So it suddenly being a boolean is a bug/breaking the protocol.

commented

From what I can tell this is a bug in whatever sends this, and type checking here is only a temporary fix. Might want to add debug the server to catch the mod sending this packet.

commented

I just went through every dependency Bewitchment has, none of them caused the bug to occur on their own, and I'm not seeing any instances where Bewitchment is modifying the vanilla player packet. I'm really not sure why it's doing what it's doing. The ones that stick out to me as potentially bad ones are Pehkui, Reach Entity Attribute, and Impersonate.

Impersonate is my best guess, since it uses an accessor on player packets. Not sure why the bug doesn't happen when Impersonate is installed with this alone though.

commented

I guess the simplest way is to add a debug dumpStracktrace to the constructor of the packet when it has id 16 and a boolean as value. That should show which mod creates it at all.