SteamWar/BauSystem2.0
Archiviert
12
0

Fix WorldData
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-23 15:21:20 +01:00
Ursprung 60f225e277
Commit b01d763ac1

Datei anzeigen

@ -24,7 +24,9 @@ import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import yapion.hierarchy.output.FileOutput; import yapion.hierarchy.output.FileOutput;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import yapion.parser.InputStreamCharsets;
import yapion.parser.YAPIONParser; import yapion.parser.YAPIONParser;
import yapion.parser.options.StreamOptions;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
@ -56,7 +58,7 @@ public class WorldData {
worldData = new YAPIONObject(); worldData = new YAPIONObject();
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); worldData = YAPIONParser.parse(bufferedInputStream, new StreamOptions().charset(InputStreamCharsets.UTF_8));
if (!worldData.containsKey("regions")) { if (!worldData.containsKey("regions")) {
YAPIONObject yapionObject = new YAPIONObject(); YAPIONObject yapionObject = new YAPIONObject();
yapionObject.add("regions", worldData); yapionObject.add("regions", worldData);