Throw Exception when generating a 30,000+ byte packet

This commit is contained in:
AlgorithmX2
2014-02-16 15:54:43 -06:00
parent 02f2eb00bd
commit 1d21f2f925
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -36,6 +36,9 @@ public abstract class AppEngPacket
public FMLProxyPacket getProxy()
{
if ( p.array().length > 30000 ) // 2k walking room :)
throw new IllegalArgumentException( "Sorry AE2 made a huge packet by accident!" );
return new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
}