Add ErrorLogging for Bugged Schematics

This commit is contained in:
2025-04-26 22:17:43 +02:00
parent d36753dec1
commit 713275ba11
@@ -149,6 +149,22 @@ fun Route.configureSchematic() {
return@let SchematicFormat.SPONGE_V2 return@let SchematicFormat.SPONGE_V2
} }
if (version == SchematicFormat.SPONGE_V3) {
try {
val fawe = schem.getCompound("Metadata")
.getCompound("WorldEdit")
.getString("Version")
if (fawe.equals("2.12.3-SNAPSHOT")) {
SWException.log("Schematic with Bugged Version Uploaded", """
Schematic=$schemName
User=${user.userName}
Id=${user.id}
""".trimIndent())
}
} catch (_: Exception) {}
}
val data = NodeData(node.id, version) val data = NodeData(node.id, version)
data.saveFromStream(content.inputStream(), version) data.saveFromStream(content.inputStream(), version)