SteamWar/BauSystem2.0
Archiviert
12
0

Speed up startup time
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-23 12:16:44 +01:00
Ursprung 405a53aa2d
Commit 60f225e277
5 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen

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;

BIN
libs/YAPION-SNAPSHOT.jar Normale Datei

Binäre Datei nicht angezeigt.