Properly save and replay FMLProxyPackets
During recording FMLProxyPackets are converted to S3FPacketCustomPayload During playback the normal Forge network stack is used to handle these packets
This commit is contained in:
@@ -68,8 +68,11 @@ public class ConnectionEventHandler {
|
||||
String worldName;
|
||||
if(event.isLocal) {
|
||||
worldName = MinecraftServer.getServer().getWorldName();
|
||||
} else {
|
||||
} else if (Minecraft.getMinecraft().getCurrentServerData() != null) {
|
||||
worldName = Minecraft.getMinecraft().getCurrentServerData().serverIP;
|
||||
} else {
|
||||
logger.info("Recording not started as the world is neither local nor remote (probably a replay).");
|
||||
return;
|
||||
}
|
||||
Channel channel = nm.channel();
|
||||
ChannelPipeline pipeline = channel.pipeline();
|
||||
|
||||
@@ -165,6 +165,7 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
||||
|
||||
if (packet instanceof FMLProxyPacket) {
|
||||
// This packet requires special handling
|
||||
((FMLProxyPacket) packet).toS3FPackets().forEach(this::save);
|
||||
super.channelRead(ctx, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user