3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 09:00:09 +01:00

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

Dieser Commit ist enthalten in:
Myles 2016-03-18 21:22:09 +00:00
Ursprung 8a35c0235e
Commit 625a1d2191

Datei anzeigen

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