SteamWar/BauSystem2.0
Archiviert
12
0

1.18 #77

Zusammengeführt
YoyoNow hat 18 Commits von 1.18 nach master 2022-03-30 11:21:07 +02:00 zusammengeführt
7 geänderte Dateien mit 14 neuen und 9 gelöschten Zeilen
Nur Änderungen aus Commit d9fd740a8f werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -43,8 +43,8 @@ sourceSets {
} }
dependencies { dependencies {
implementation 'yoyosource:YAPION:0.25.3' // implementation 'yoyosource:YAPION:0.25.3'
// implementation files("${projectDir}/../lib/YAPION-SNAPSHOT.jar") implementation files("${projectDir}/../libs/YAPION-SNAPSHOT.jar")
compileOnly 'org.projectlombok:lombok:1.18.22' compileOnly 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22' testCompileOnly 'org.projectlombok:lombok:1.18.22'

Datei anzeigen

@ -36,6 +36,7 @@ import org.bukkit.inventory.meta.ItemMeta;
import yapion.hierarchy.output.StreamOutput; import yapion.hierarchy.output.StreamOutput;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import yapion.parser.YAPIONParser; import yapion.parser.YAPIONParser;
import yapion.parser.options.StreamOptions;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -58,7 +59,7 @@ public class LaufbauUtils implements Listener {
} }
byte[] bytes = Base64.getDecoder().decode(config); byte[] bytes = Base64.getDecoder().decode(config);
@Cleanup GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(bytes)); @Cleanup GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(bytes));
YAPIONObject yapionObject = new YAPIONParser(gzipInputStream, true).parse().result(); YAPIONObject yapionObject = new YAPIONParser(gzipInputStream, new StreamOptions().stopOnStreamEnd(true)).parse().result();
yapionObjectMap.put(event.getPlayer(), yapionObject); yapionObjectMap.put(event.getPlayer(), yapionObject);
} }

Datei anzeigen

@ -22,7 +22,7 @@ package de.steamwar.bausystem.region.loader;
import de.steamwar.bausystem.region.Prototype; import de.steamwar.bausystem.region.Prototype;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import yapion.hierarchy.diff.DiffBase; import yapion.hierarchy.diff.DiffDelete;
import yapion.hierarchy.diff.YAPIONDiff; import yapion.hierarchy.diff.YAPIONDiff;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import yapion.parser.YAPIONParser; import yapion.parser.YAPIONParser;
@ -46,7 +46,7 @@ public class PrototypeLoader {
throw new SecurityException(e.getMessage(), e); throw new SecurityException(e.getMessage(), e);
} }
if (loaded != null && new YAPIONDiff(loaded, yapionObject).getDiffs().stream().anyMatch(diffBase -> (diffBase instanceof DiffBase.DiffDelete))) { if (loaded != null && new YAPIONDiff(loaded, yapionObject).getDiffs().stream().anyMatch(DiffDelete.class::isInstance)) {
throw new SecurityException("Version was not the specified version needed."); throw new SecurityException("Version was not the specified version needed.");
} }
loaded = yapionObject; loaded = yapionObject;

Datei anzeigen

@ -25,7 +25,7 @@ import de.steamwar.bausystem.region.Prototype;
import de.steamwar.bausystem.worlddata.WorldData; import de.steamwar.bausystem.worlddata.WorldData;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import yapion.hierarchy.diff.DiffBase; import yapion.hierarchy.diff.DiffChange;
import yapion.hierarchy.diff.YAPIONDiff; import yapion.hierarchy.diff.YAPIONDiff;
import yapion.hierarchy.types.YAPIONObject; import yapion.hierarchy.types.YAPIONObject;
import yapion.hierarchy.types.YAPIONType; import yapion.hierarchy.types.YAPIONType;
@ -50,7 +50,7 @@ public class RegionLoader {
throw new SecurityException(e.getMessage(), e); throw new SecurityException(e.getMessage(), e);
} }
if (loaded != null && new YAPIONDiff(loaded, yapionObject).getDiffs().stream().anyMatch(diffBase -> !(diffBase instanceof DiffBase.DiffChange))) { if (loaded != null && new YAPIONDiff(loaded, yapionObject).getDiffs().stream().anyMatch(diffBase -> !(diffBase instanceof DiffChange))) {
throw new SecurityException("Version was not the specified version needed."); throw new SecurityException("Version was not the specified version needed.");
} }
loaded = yapionObject; loaded = yapionObject;

Datei anzeigen

@ -27,7 +27,9 @@ import org.bukkit.entity.Player;
import yapion.hierarchy.output.FileOutput; import yapion.hierarchy.output.FileOutput;
import yapion.hierarchy.types.YAPIONArray; import yapion.hierarchy.types.YAPIONArray;
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.FileOptions;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
@ -47,7 +49,7 @@ public class SimulatorData {
if (!file.exists()) { if (!file.exists()) {
return new YAPIONObject(); return new YAPIONObject();
} }
return YAPIONParser.parse(file); return YAPIONParser.parse(file, new FileOptions().charset(InputStreamCharsets.UTF_8));
} }
@SneakyThrows @SneakyThrows

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);

BIN
libs/YAPION-SNAPSHOT.jar Normale Datei

Binäre Datei nicht angezeigt.