@Override
	protected void decode( ChannelHandlerContext ctx, ByteBuf in, List<Object> out ) throws Exception
	{
		int byteSize = in.readableBytes();
		if(byteSize == 0 || !ctx.channel().isOpen())
			return;
		
		int id = Utils.readVarInt(in);
		int conState = ctx.channel().attr(Utils.connectionState).get();

		switch(conState)
		{
		case 1: // Status
			switch(id)
			{
			case 0: // Status
				MCListener.logger.info(String.format("%s pinged the server using MC 1.7", Utils.getAddressString(ctx.channel().remoteAddress())));
				send(ctx, writeStatusPacket());
				break;
			case 1: // Ping
				send(ctx, writePongPacket(in.readLong()));
				break;
			}
			break;
		case 2: // Login
			MCListener.logger.info(String.format("%s connected using MC 1.7", Utils.getAddressString(ctx.channel().remoteAddress())));
			disconnect(ctx, MCListener.kickMessage);
			break;
		}
		
	}