Let Minecraft handle packet decoding during playback

We've done this ourselves only because it was easier at the beginning.
However by now (and especially with 1.20.5), Minecraft's packet decoding
has become substantially more sophisticated, to the point that it's
probably a bad idea to try to do it ourselves.

This commit gives back that responsibility to Minecraft by adding the
standard decoder (and encoder because it's required for proper
connection state management on modern versions) to our channel pipeline,
changes the full and the quick replay sender to send raw `ByteBuf`s into
the front of the channel, and moves the posititon of the full replay
sender in the channel pipeline such that it can see and modify packets
after Minecraft has decoded them.
This commit is contained in:
Jonas Herzig
2024-05-12 17:55:07 +02:00
parent ad49a69f37
commit fe0677923c
5 changed files with 50 additions and 138 deletions

View File

@@ -25,6 +25,8 @@ net.minecraft.network.play.server.SPacketSpawnPlayer getDataManagerEntries() fun
net.minecraft.client.multiplayer.ServerList saveSingleServer() func_147414_b()
net.minecraft.util.SoundEvent com.replaymod.core.versions.MCVer.SoundEvent
net.minecraft.network.NettyPacketDecoder net.minecraft.util.MessageDeserializer
net.minecraft.network.NettyPacketEncoder net.minecraft.util.MessageSerializer
net.minecraft.network.play.server.SPacketJoinGame net.minecraft.network.play.server.S01PacketJoinGame
net.minecraft.network.play.server.SPacketChat net.minecraft.network.play.server.S02PacketChat
net.minecraft.network.play.server.SPacketParticles net.minecraft.network.play.server.S2APacketParticles