SteamWar/SpigotCore
Archiviert
13
0

Fix buffering issues in replays
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2023-08-31 19:00:35 +02:00
Ursprung 311bb09a19
Commit aaaaa87999

Datei anzeigen

@ -19,13 +19,12 @@
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.io.MCEditSchematicReader;
import com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicReader;
import de.steamwar.sql.NoClipboardException;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
@ -35,9 +34,9 @@ public class WorldEditWrapper18 extends WorldEditWrapper14 {
@SuppressWarnings("removal")
public Clipboard getClipboard(InputStream is, boolean schemFormat) throws IOException {
//Use FAWE reader due to FAWE capability of reading corrupt FAWE schems
NBTInputStream nbtStream = new NBTInputStream(new BufferedInputStream(is));
NBTInputStream nbtStream = new NBTInputStream(is);
try {
return (schemFormat ? new FastSchematicReader(nbtStream) : new MCEditSchematicReader(nbtStream)).read();
return (schemFormat ? new SpongeSchematicReader(nbtStream) : new MCEditSchematicReader(nbtStream)).read();
} catch (NullPointerException e) {
throw new NoClipboardException();
}