Fix Schematic Upload
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-01-20 17:38:32 +01:00
parent 0ce7429151
commit 8da9a3cfbb

View File

@ -128,15 +128,15 @@ fun Route.configureSchematic() {
val user = call.principal<SWAuthPrincipal>()!!.user val user = call.principal<SWAuthPrincipal>()!!.user
var node = SchematicNode.getSchematicNode(user.id, schemName, 0) var node = SchematicNode.getSchematicNode(user.id, schemName, null as Int?)
if (node == null) { if (node == null) {
node = SchematicNode.createSchematic(user.id, schemName, 0) node = SchematicNode.createSchematic(user.id, schemName, null)
} }
try { try {
val content = Base64.getDecoder().decode(file.content) val content = Base64.getDecoder().decode(file.content)
var schem = nbt.fromStream(DataInputStream(BufferedInputStream(GZIPInputStream(ByteArrayInputStream(content))))) var schem = nbt.fromStream(DataInputStream(BufferedInputStream(GZIPInputStream(content.inputStream()))))
if (schem.size() == 1) schem = schem.first() as CompoundTag if (schem.size() == 1) schem = schem.first() as CompoundTag