Fix #686 - rewriting of bows and fishing hooks

This commit is contained in:
md_5 2013-11-01 17:38:53 +11:00
parent 7205e69ce6
commit 3becbe4d38

View File

@ -2,6 +2,7 @@ package net.md_5.bungee;
import io.netty.buffer.ByteBuf;
import net.md_5.bungee.protocol.DefinedPacket;
import net.md_5.bungee.protocol.PacketWrapper;
/**
* Class to rewrite integers within packets.
@ -66,6 +67,22 @@ public class EntityMap
}
}
if ( packetId == 0x0E )
{
DefinedPacket.readVarInt( packet );
byte type = packet.readByte();
if ( type == 60 || type == 90 )
{
packet.skipBytes( 14 );
int pos = packet.readerIndex();
int shooterId = packet.getInt( pos );
if ( shooterId == oldId )
{
packet.setInt( pos, newId );
}
}
}
packet.readerIndex( readerIndex );
}
}