|
@ -42,7 +42,6 @@ public class Data { |
|
|
|
|
|
|
|
|
if (!data.contains("version")) { |
|
|
if (!data.contains("version")) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (data.contains("hoppers")) { |
|
|
if (data.contains("hoppers")) { |
|
|
for (String rawh : data.getConfigurationSection("hoppers").getKeys(false)) { |
|
|
for (String rawh : data.getConfigurationSection("hoppers").getKeys(false)) { |
|
|
String loc = "hoppers." + rawh; |
|
|
String loc = "hoppers." + rawh; |
|
@ -61,20 +60,23 @@ public class Data { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static long last; |
|
|
|
|
|
|
|
|
private static void saveData() { |
|
|
private static void saveData() { |
|
|
//
|
|
|
|
|
|
// if (System.currentTimeMillis() - last < 1000) {
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
// Bukkit.getScheduler().runTaskAsynchronously(Main.p, () -> {
|
|
|
|
|
|
try { |
|
|
|
|
|
data.save(dataf); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (System.currentTimeMillis() - last < 3000) { |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
last = System.currentTimeMillis(); |
|
|
|
|
|
|
|
|
|
|
|
Bukkit.getScheduler().runTaskAsynchronously(Main.p, () -> { |
|
|
|
|
|
try { |
|
|
|
|
|
data.save(dataf); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static short genMapId() { |
|
|
private static short genMapId() { |
|
@ -138,7 +140,7 @@ public class Data { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static OfflinePlayer getOwningPlayer(Location loc) { |
|
|
|
|
|
|
|
|
public static OfflinePlayer getOwningPlayer(Location loc) { |
|
|
String cloc = "hoppers." + WorldMgr.serializeLocation(loc); |
|
|
String cloc = "hoppers." + WorldMgr.serializeLocation(loc); |
|
|
|
|
|
|
|
|
if (data.contains(cloc + ".owner")) { |
|
|
if (data.contains(cloc + ".owner")) { |
|
|