Merge branch 'master' into 1.18
Dieser Commit ist enthalten in:
Commit
d9fd740a8f
@ -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'
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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
|
||||||
|
@ -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
libs/YAPION-SNAPSHOT.jar
Normale Datei
Binäre Datei nicht angezeigt.
In neuem Issue referenzieren
Einen Benutzer sperren