diff --git a/CommonCore b/CommonCore index bd626bb..e9a39d0 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit bd626bb4e6366f1e5e7e64765a6e47fefe05b16a +Subproject commit e9a39d007d83a93e7dc50ab2706c9f16213bc900 diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicData.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicData.java index 2c259ab..635aa6c 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicData.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicData.java @@ -22,17 +22,24 @@ package de.steamwar.sql; import com.sk89q.worldedit.extent.clipboard.Clipboard; import de.steamwar.core.Core; import de.steamwar.core.WorldEditWrapper; +import de.steamwar.sql.internal.SqlTypeMapper; import de.steamwar.sql.internal.Statement; import org.bukkit.entity.Player; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.PipedInputStream; import java.sql.Blob; +import java.sql.PreparedStatement; import java.util.zip.GZIPInputStream; public class SchematicData { + static { + new SqlTypeMapper<>(PipedInputStream.class, "BLOB", (rs, identifier) -> { throw new SecurityException("PipedInputStream is write only datatype"); }, PreparedStatement::setBinaryStream); + } + public static Clipboard clipboardFromStream(InputStream is, boolean schemFormat) { try { return WorldEditWrapper.impl.getClipboard(is, schemFormat);