Cap VarInt down to 4 bytes. Early Mojang implementations used 32 BYTES, then they changed it to 5 BYTES. I think they mean 4 BYTES = 32 BITS.

This commit is contained in:
md_5 2014-02-12 19:51:43 +11:00
parent 90104b03b7
commit 87f3706736

View File

@ -78,7 +78,7 @@ public abstract class DefinedPacket
out |= ( in & 0x7F ) << ( bytes++ * 7 );
if ( bytes > 32 )
if ( bytes > 4 )
{
throw new RuntimeException( "VarInt too big" );
}