public synchronized void addHandler ( final short packetID , final PacketHandler packetHandler ) { if ( registry . containsKey ( packetID ) ) throw new IllegalArgumentException ( "Handler for ID: " + packetID + " already exists" ) ; registry . put ( packetID , packetHandler ) ; }
Adds a new handler for this specific Packet ID