{"record":{"id":"0862fb3e265acd55","repo":"Anuken/Mindustry","slug":"unknown-version-ver-are-you-trying-to-load-a-s","errorCode":null,"errorMessage":"Unknown version: {ver} (are you trying to load a schematic from a newer version of the game?)","messagePattern":"Unknown version: (.+?) \\(are you trying to load a schematic from a newer version of the game\\?\\)","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/game/Schematics.java","lineNumber":579,"sourceCode":"    public static Schematic read(Fi file) throws IOException{\n        Schematic s = read(new DataInputStream(file.read(1024)));\n        if(!s.tags.containsKey(\"name\")){\n            s.tags.put(\"name\", file.nameWithoutExtension());\n        }\n        s.file = file;\n        return s;\n    }\n\n    public static Schematic read(InputStream input) throws IOException{\n        for(byte b : header){\n            if(input.read() != b){\n                throw new IOException(\"Not a schematic file (missing header).\");\n            }\n        }\n\n        int ver = input.read();\n\n        if(ver > version) throw new IOException(\"Unknown version: \" + ver + \" (are you trying to load a schematic from a newer version of the game?)\");\n\n        try(DataInputStream stream = new DataInputStream(new InflaterInputStream(input))){\n            short width = stream.readShort(), height = stream.readShort();\n\n            if(limitSchematicSize && (width > 128 || height > 128)) throw new IOException(\"Invalid schematic: Too large (max possible size is 128x128)\");\n\n            StringMap map = new StringMap();\n            int tags = stream.readUnsignedByte();\n            for(int i = 0; i < tags; i++){\n                map.put(stream.readUTF(), stream.readUTF());\n            }\n\n            ContentMapper mapper = null;\n\n            //set up content mapping if found; this should not fail\n            if(map.containsKey(\"contentMap\")){\n                IntMap<ObjectIntMap<String>> nameMap = JsonIO.json.fromJson(IntMap.class, ObjectIntMap.class, map.get(\"contentMap\", \"{}\"));\n                IntMap<IntMap<Content>> contentMap = new IntMap<>();","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/game/Schematics.java#L561-L597","documentation":"Thrown by Schematics.read(InputStream) after the header passes, when the version byte read from the stream is greater than the supported schematic version (Schematics.version, currently 1). This is a forward-compatibility guard: a higher version implies a format the running code cannot safely parse.","triggerScenarios":"Loading a schematic saved by a newer game version. The header is valid but the following byte (ver) > Schematics.version. The message hints the user may be loading a schematic from a newer game.","commonSituations":"Player shares a schematic made in a newer Mindustry build with someone on an older build; loading schematics imported across version boundaries; dev builds with bumped version read by stable.","solutions":["Update Mindustry to a version >= the one that created the schematic.","Re-save the schematic in an older/compatible version, or obtain a version-1 schematic.","Catch the IOException and inform the user the schematic requires a newer game version."],"exampleFix":"// before\nSchematic s = Schematics.read(input);\n\n// after\ntry{\n    Schematic s = Schematics.read(input);\n}catch(IOException e){\n    ui.showErrorMessage(\"This schematic was made by a newer version of the game.\");\n}","handlingStrategy":"try-catch","validationCode":"// version is read after header; pre-check the game/schematic source version if known\nif(knownSchematicVersion > Schematics.version){\n    ui.showErrorMessage(\"Schematic requires a newer game version\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try{ Schematic s = Schematics.read(input); }catch(IOException e){ ui.showErrorMessage(\"Unsupported schematic version\"); }","preventionTips":["Keep the game updated to read newer schematic versions.","Catch IOException around Schematics.read and inform the user.","Tag schematics with the creating version when storing them."],"tags":["schematic","version","io","save-compat"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}