From a710698277d6edd83e82c7e9269f56956539655e Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 23 Jul 2018 12:07:30 +1000 Subject: [PATCH] #2482: Fix error in reading slots --- .../main/java/net/md_5/bungee/entitymap/EntityMap.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java index 049aa2e8e..faa94c87b 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java @@ -157,7 +157,7 @@ public abstract class EntityMap packet.skipBytes( 16 ); // float, float, float, flat break; case 27: // item - readSkipSlot( packet ); + readSkipSlot( packet, protocolVersion ); break; } break; @@ -192,7 +192,7 @@ public abstract class EntityMap DefinedPacket.readString( packet ); break; case 5: - readSkipSlot( packet ); + readSkipSlot( packet, protocolVersion ); break; case 6: packet.skipBytes( 1 ); // boolean @@ -238,11 +238,11 @@ public abstract class EntityMap packet.readerIndex( readerIndex ); } - private static void readSkipSlot(ByteBuf packet) + private static void readSkipSlot(ByteBuf packet, int protocolVersion) { if ( packet.readShort() != -1 ) { - packet.skipBytes( 3 ); // byte, short + packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short int position = packet.readerIndex(); if ( packet.readByte() != 0 )