1.18 #77
@ -43,8 +43,8 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'yoyosource:YAPION:0.25.3'
|
||||
// implementation files("${projectDir}/../lib/YAPION-SNAPSHOT.jar")
|
||||
// implementation 'yoyosource:YAPION:0.25.3'
|
||||
implementation files("${projectDir}/../libs/YAPION-SNAPSHOT.jar")
|
||||
|
||||
compileOnly 'org.projectlombok:lombok:1.18.22'
|
||||
testCompileOnly 'org.projectlombok:lombok:1.18.22'
|
||||
|
@ -36,6 +36,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import yapion.hierarchy.output.StreamOutput;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.parser.YAPIONParser;
|
||||
import yapion.parser.options.StreamOptions;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -58,7 +59,7 @@ public class LaufbauUtils implements Listener {
|
||||
}
|
||||
byte[] bytes = Base64.getDecoder().decode(config);
|
||||
@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);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ package de.steamwar.bausystem.region.loader;
|
||||
import de.steamwar.bausystem.region.Prototype;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Bukkit;
|
||||
import yapion.hierarchy.diff.DiffBase;
|
||||
import yapion.hierarchy.diff.DiffDelete;
|
||||
import yapion.hierarchy.diff.YAPIONDiff;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.parser.YAPIONParser;
|
||||
@ -46,7 +46,7 @@ public class PrototypeLoader {
|
||||
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.");
|
||||
}
|
||||
loaded = yapionObject;
|
||||
|
@ -25,7 +25,7 @@ import de.steamwar.bausystem.region.Prototype;
|
||||
import de.steamwar.bausystem.worlddata.WorldData;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Bukkit;
|
||||
import yapion.hierarchy.diff.DiffBase;
|
||||
import yapion.hierarchy.diff.DiffChange;
|
||||
import yapion.hierarchy.diff.YAPIONDiff;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.hierarchy.types.YAPIONType;
|
||||
@ -50,7 +50,7 @@ public class RegionLoader {
|
||||
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.");
|
||||
}
|
||||
loaded = yapionObject;
|
||||
|
@ -27,7 +27,9 @@ import org.bukkit.entity.Player;
|
||||
import yapion.hierarchy.output.FileOutput;
|
||||
import yapion.hierarchy.types.YAPIONArray;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.parser.InputStreamCharsets;
|
||||
import yapion.parser.YAPIONParser;
|
||||
import yapion.parser.options.FileOptions;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@ -47,7 +49,7 @@ public class SimulatorData {
|
||||
if (!file.exists()) {
|
||||
return new YAPIONObject();
|
||||
}
|
||||
return YAPIONParser.parse(file);
|
||||
return YAPIONParser.parse(file, new FileOptions().charset(InputStreamCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
@ -24,7 +24,9 @@ import lombok.experimental.UtilityClass;
|
||||
import org.bukkit.Bukkit;
|
||||
import yapion.hierarchy.output.FileOutput;
|
||||
import yapion.hierarchy.types.YAPIONObject;
|
||||
import yapion.parser.InputStreamCharsets;
|
||||
import yapion.parser.YAPIONParser;
|
||||
import yapion.parser.options.StreamOptions;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
@ -56,7 +58,7 @@ public class WorldData {
|
||||
worldData = new YAPIONObject();
|
||||
if (optionsFile.length() != 0) {
|
||||
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")) {
|
||||
YAPIONObject yapionObject = new YAPIONObject();
|
||||
yapionObject.add("regions", worldData);
|
||||
|
BIN
libs/YAPION-SNAPSHOT.jar
Normale Datei
BIN
libs/YAPION-SNAPSHOT.jar
Normale Datei
Binäre Datei nicht angezeigt.
In neuem Issue referenzieren
Einen Benutzer sperren