Eventually we should have some sort of handler for this, but this is fine for now

This commit is contained in:
Myles 2016-03-18 21:22:09 +00:00
parent 8a35c0235e
commit 625a1d2191

View File

@ -4,6 +4,8 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.ClientChunks;
import java.util.List;
@ -24,8 +26,10 @@ public class ViaChunkHandler extends MessageToMessageEncoder {
info.setLastPacket(o);
/* This transformer is more for fixing issues which we find hard at packet level :) */
if (o.getClass().getName().endsWith("PacketPlayOutMapChunkBulk") && info.isActive()) {
list.addAll(info.get(ClientChunks.class).transformMapChunkBulk(o));
return;
if (info.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
list.addAll(info.get(ClientChunks.class).transformMapChunkBulk(o));
return;
}
}
}