diff --git a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java index c0318d0..5ab3634 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java @@ -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); }