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