Add specific exception for bad packets.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package net.md_5.bungee.protocol;
|
||||
|
||||
public class BadPacketException extends RuntimeException
|
||||
{
|
||||
|
||||
public BadPacketException(String message)
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
}
|
@@ -78,7 +78,7 @@ public class Vanilla implements Protocol
|
||||
DefinedPacket packet = read( packetId, buf, this );
|
||||
if ( buf.readerIndex() == start )
|
||||
{
|
||||
throw new RuntimeException( "Unknown packet id " + packetId );
|
||||
throw new BadPacketException( "Unknown packet id " + packetId );
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
Reference in New Issue
Block a user