From d1d4cc7bbfc648caf91bbe8371e29a295cf535ea Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 30 Jul 2014 09:26:17 +0100 Subject: [PATCH] Tidy up the handling of Spawn Object and fix a off by one error with it --- .../net/md_5/bungee/entitymap/EntityMap_1_7_2.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java index efa6b0de..59433bc4 100644 --- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java +++ b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java @@ -61,21 +61,21 @@ class EntityMap_1_7_2 extends EntityMap } else if ( packetId == 0x0E /* Spawn Object */ ) { DefinedPacket.readVarInt( packet ); - int idLength = packet.readerIndex() - readerIndex - packetIdLength; - - int type = packet.getByte( packetIdLength + idLength ); + int type = packet.readUnsignedByte(); if ( type == 60 || type == 90 ) { - int readId = packet.getInt( packetIdLength + idLength + 15 ); + packet.skipBytes( 14 ); + int position = packet.readerIndex(); + int readId = packet.readInt(); int changedId = -1; if ( readId == oldId ) { - packet.setInt( packetIdLength + idLength + 15, newId ); + packet.setInt( position, newId ); changedId = newId; } else if ( readId == newId ) { - packet.setInt( packetIdLength + idLength + 15, oldId ); + packet.setInt( position, oldId ); changedId = oldId; } if ( changedId != -1 )