Exemple #1
0
 public static int saveAll() {
   int i = 0;
   for (LikeSign ls : signs.values()) {
     ls.save();
     i++;
   }
   return i;
 }
Exemple #2
0
  /**
   * 新規評価看板をDBに登録する
   *
   * @param sign
   * @param creator
   * @param sign_name
   * @param description
   * @return
   */
  public static boolean createSign(
      final Sign sign, final Player creator, final String sign_name, final String description) {
    if (sign == null || sign.getBlock() == null || creator == null || sign_name == null) {
      return false;
    }

    final Location loc = sign.getBlock().getLocation();

    LikeSign ls =
        new LikeSign(
            0, sign_name, creator.getName(), 0, description, 0, 0, Util.getCurrentUnixSec(), loc);
    ls.save(true); // INSERT

    // Add
    signs.put(loc, ls);
    return true;
  }