forked from SteamWar/SteamWar
Optimize WorldData
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.worlddata;
|
package de.steamwar.bausystem.worlddata;
|
||||||
|
|
||||||
import de.steamwar.sql.SteamwarUser;
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import yapion.hierarchy.output.FileOutput;
|
import yapion.hierarchy.output.FileOutput;
|
||||||
@@ -59,15 +58,11 @@ public class WorldData {
|
|||||||
if (optionsFile.length() != 0) {
|
if (optionsFile.length() != 0) {
|
||||||
try (BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(optionsFile))) {
|
try (BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(optionsFile))) {
|
||||||
worldData = YAPIONParser.parse(bufferedInputStream, new StreamOptions().charset(InputStreamCharsets.UTF_8));
|
worldData = YAPIONParser.parse(bufferedInputStream, new StreamOptions().charset(InputStreamCharsets.UTF_8));
|
||||||
if (!worldData.containsKey("regions")) {
|
|
||||||
YAPIONObject yapionObject = new YAPIONObject();
|
|
||||||
yapionObject.add("regions", worldData);
|
|
||||||
worldData = yapionObject;
|
|
||||||
write();
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Ignored
|
// Ignored
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user