Tweaked performance of data save and campfire check

This commit is contained in:
Sn0wStorm
2019-11-24 16:06:17 +01:00
parent a1c0116650
commit 32b6c3c4b1
6 changed files with 56 additions and 29 deletions
+10
View File
@@ -32,8 +32,18 @@ public class BData {
File file = new File(P.p.getDataFolder(), "data.yml");
if (file.exists()) {
long t1 = System.currentTimeMillis();
FileConfiguration data = YamlConfiguration.loadConfiguration(file);
long t2 = System.currentTimeMillis();
if (t2 - t1 > 5000) {
// Spigot is very slow at loading inventories from yml. Notify Admin that loading Data took long
P.p.log("Bukkit took " + (t2 - t1) / 1000.0 + "s to load the Data File,");
P.p.log("consider switching to Paper, or have less items in Barrels");
}
Brew.installTime = data.getLong("installTime", System.currentTimeMillis());
MCBarrel.mcBarrelTime = data.getLong("MCBarrelTime", 0);