diff --git a/src/main/java/net/minecraftforge/fml/common/network/FMLIndexedMessageToMessageCodec.java b/src/main/java/net/minecraftforge/fml/common/network/FMLIndexedMessageToMessageCodec.java index 1e4444a9a..62ff2dd42 100644 --- a/src/main/java/net/minecraftforge/fml/common/network/FMLIndexedMessageToMessageCodec.java +++ b/src/main/java/net/minecraftforge/fml/common/network/FMLIndexedMessageToMessageCodec.java @@ -70,6 +70,10 @@ public abstract class FMLIndexedMessageToMessageCodec extends MessageToMessag { testMessageValidity(msg); ByteBuf payload = msg.payload().copy(); + if (payload.readableBytes() < 1) + { + FMLLog.log(Level.ERROR, "The FMLIndexedCodec has received an empty buffer on channel %s, likely a result of a LAN server issue. Pipeline parts : %s", ctx.channel().attr(NetworkRegistry.FML_CHANNEL), ctx.pipeline().toString()); + } byte discriminator = payload.readByte(); Class clazz = discriminators.get(discriminator); if(clazz == null)