SteamWar/SpigotCore
Archiviert
13
0

Change Schematic version dependant calls

Dieser Commit ist enthalten in:
jojo 2020-12-25 18:35:45 +01:00
Ursprung e0f6b2e5bf
Commit f3ada581af

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.sql;
import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.io.IOException; import java.io.IOException;
@ -189,17 +190,8 @@ public class Schematic {
if(schemData == null) if(schemData == null)
throw new IOException("SchemData is null"); throw new IOException("SchemData is null");
InputStream is = schemData.getBinaryStream(); InputStream is = schemData.getBinaryStream();
switch(Core.getVersion()){ return VersionedCallable.call(new VersionedCallable<>(() -> Schematic_8.getClipboard(is, schemFormat), 8),
case 8: new VersionedCallable<>(() -> Schematic_14.getClipboard(is, schemFormat), 14));
case 9:
case 10:
case 12:
return Schematic_8.getClipboard(is, schemFormat);
case 14:
case 15:
default:
return Schematic_14.getClipboard(is, schemFormat);
}
} catch (SQLException e) { } catch (SQLException e) {
throw new IOException(e); throw new IOException(e);
} }