Ejemplo n.º 1
0
  public static void setBuildLocation(Player player, Location loc) {

    for (int i = 0; i < builds.size(); ++i) {
      tpLocation b = builds.get(i);
      if (b.playername.equalsIgnoreCase(player.getName())) {
        DatabaseManager.UpdateBuild(player, loc);
        b.loc = loc;
        return;
      }
    }

    DatabaseManager.AddBuild(player.getName(), loc);

    tpLocation neBuild = new tpLocation();
    neBuild.playername = player.getName();
    neBuild.loc = loc;
    builds.add(neBuild);
  }
Ejemplo n.º 2
0
  public static void setHomeLocation(Player player, Location loc) {

    for (int i = 0; i < homes.size(); ++i) {
      tpLocation b = homes.get(i);
      if (b.playername.equalsIgnoreCase(player.getName())
          && player.getLocation().getWorld() == b.loc.getWorld()) {
        DatabaseManager.UpdateHome(player, loc);
        b.loc = loc;
        return;
      }
    }

    DatabaseManager.AddHome(player.getName(), loc);

    tpLocation newHome = new tpLocation();
    newHome.playername = player.getName();
    newHome.loc = loc;
    homes.add(newHome);
  }