@Override
  public void storeCraftCooldowns(final Player player) {
    deleteCraftCoolDowns(player);
    Map<Integer, Long> craftCoolDowns = player.getCraftCooldownList().getCraftCoolDowns();

    if (craftCoolDowns == null) {
      return;
    }

    for (Map.Entry<Integer, Long> entry : craftCoolDowns.entrySet()) {
      final int delayId = entry.getKey();
      final long reuseTime = entry.getValue();

      if (reuseTime < System.currentTimeMillis()) {
        continue;
      }

      Connection con = null;

      try {
        con = DatabaseFactory.getConnection();
        PreparedStatement stmt = con.prepareStatement(INSERT_QUERY);

        stmt.setInt(1, player.getObjectId());
        stmt.setInt(2, delayId);
        stmt.setLong(3, reuseTime);
        stmt.execute();
      } catch (SQLException e) {
        log.error("storecraftCoolDowns", e);
      } finally {
        DatabaseFactory.close(con);
      }
    }
  }
  @Override
  public void loadCraftCooldowns(final Player player) {
    Connection con = null;
    FastMap<Integer, Long> craftCoolDowns = new FastMap<Integer, Long>();
    try {
      con = DatabaseFactory.getConnection();
      PreparedStatement stmt = con.prepareStatement(SELECT_QUERY);

      stmt.setInt(1, player.getObjectId());
      ResultSet rset = stmt.executeQuery();

      while (rset.next()) {
        int delayId = rset.getInt("delay_id");
        long reuseTime = rset.getLong("reuse_time");
        int delay = (int) ((reuseTime - System.currentTimeMillis()) / 1000);

        if (delay > 0) {
          craftCoolDowns.put(delayId, reuseTime);
        }
      }
      player.getCraftCooldownList().setCraftCoolDowns(craftCoolDowns);
      rset.close();
      stmt.close();
    } catch (SQLException e) {
      log.error("LoadcraftCoolDowns", e);
    } finally {
      DatabaseFactory.close(con);
    }
  }