public static void setLocation(String type, Location loc) { Files.getDataFile().set(type + ".world", loc.getWorld().getName()); Files.getDataFile().set(type + ".x", loc.getBlockX()); Files.getDataFile().set(type + ".y", loc.getBlockY()); Files.getDataFile().set(type + ".z", loc.getBlockZ()); Files.saveDataFile(); }
public static Location getLocation(String type) { Location loc = new Location( Bukkit.getWorld(Files.getDataFile().getString(type + ".world")), Files.getDataFile().getInt(type + ".x"), Files.getDataFile().getInt(type + ".y"), Files.getDataFile().getInt(type + ".z")); return loc; }