SteamWar/SpigotCore
Archiviert
13
0

Fix double GZIP decompression
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2023-08-30 12:39:19 +02:00
Ursprung d1478cf148
Commit 11396cc69c

Datei anzeigen

@ -19,8 +19,10 @@
package de.steamwar.core; package de.steamwar.core;
import com.fastasyncworldedit.core.extent.clipboard.io.FastSchematicReader;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.BuiltInClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.MCEditSchematicReader;
import de.steamwar.sql.NoClipboardException; import de.steamwar.sql.NoClipboardException;
import java.io.IOException; import java.io.IOException;
@ -29,14 +31,12 @@ import java.io.InputStream;
public class WorldEditWrapper18 extends WorldEditWrapper14 { public class WorldEditWrapper18 extends WorldEditWrapper14 {
@Override @Override
@SuppressWarnings("removal")
public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException { public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException {
//Use FAWE reader due to FAWE capability of reading corrupt FAWE schems //Use FAWE reader due to FAWE capability of reading corrupt FAWE schems
NBTInputStream nbtStream = new NBTInputStream(is);
try { try {
if(schemFormat){ return (schemFormat ? new FastSchematicReader(nbtStream) : new MCEditSchematicReader(nbtStream)).read();
return BuiltInClipboardFormat.FAST.load(is);
}else{
return BuiltInClipboardFormat.MCEDIT_SCHEMATIC.load(is);
}
} catch (NullPointerException e) { } catch (NullPointerException e) {
throw new NoClipboardException(); throw new NoClipboardException();
} }