From b6ce24c8bdec135eb13b1616e91f156135c219de Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 3 May 2024 15:38:47 +0200 Subject: [PATCH] Always write identifier-table output file --- output_hashes.json | 40 +++++++++---------- .../mappingsgenerator/MappingsOptimizer.java | 12 +++--- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/output_hashes.json b/output_hashes.json index 7565ee6..2d1a372 100644 --- a/output_hashes.json +++ b/output_hashes.json @@ -1,58 +1,58 @@ { "1.13": { - "object-hash": 1835999558, + "object-hash": 1835999553, "size": 94 }, "1.13.2": { - "object-hash": 214381667, + "object-hash": 214381662, "size": 192 }, "1.14": { - "object-hash": 1631090930, + "object-hash": 1631090925, "size": 570 }, "1.15": { - "object-hash": 667164485, + "object-hash": 667164480, "size": 594 }, "1.16": { - "object-hash": 978512762, + "object-hash": 978512757, "size": 1210 }, "1.16.2": { - "object-hash": 1064891088, + "object-hash": 1064891083, "size": 1394 }, "1.17": { - "object-hash": -1238441101, + "object-hash": -1238441106, "size": 2594 }, "1.18": { - "object-hash": 521012559, + "object-hash": 521012554, "size": 2707 }, "1.19": { - "object-hash": -929747200, + "object-hash": -929747205, "size": 3444 }, "1.19.3": { - "object-hash": 537457037, + "object-hash": 537457032, "size": 3583 }, "1.19.4": { - "object-hash": -2120264184, + "object-hash": -2120264189, "size": 4215 }, "1.20": { - "object-hash": 1019999243, + "object-hash": 1019999238, "size": 4287 }, "1.20.2": { - "object-hash": 1019999243, + "object-hash": 1019999238, "size": 4287 }, "1.20.3": { - "object-hash": -898988321, + "object-hash": -898988326, "size": 4568 }, "1.20.5": { @@ -60,11 +60,11 @@ "size": 4840 }, "3D_Shareware": { - "object-hash": -639482332, + "object-hash": -639482337, "size": 972 }, "20w14infinite": { - "object-hash": 682358467, + "object-hash": 682358462, "size": 1522 }, "1.10:1.9.4": { @@ -220,11 +220,11 @@ "size": 4864 }, "1.20.5:1.21": { - "object-hash": 1974034079, - "size": 344 + "object-hash": -1185141951, + "size": 312 }, "1.21:1.20.5": { - "object-hash": 1870030776, - "size": 641 + "object-hash": 655633032, + "size": 794 } } \ No newline at end of file diff --git a/src/main/java/com/viaversion/mappingsgenerator/MappingsOptimizer.java b/src/main/java/com/viaversion/mappingsgenerator/MappingsOptimizer.java index 2d124e8..a8759ea 100644 --- a/src/main/java/com/viaversion/mappingsgenerator/MappingsOptimizer.java +++ b/src/main/java/com/viaversion/mappingsgenerator/MappingsOptimizer.java @@ -296,13 +296,14 @@ public final class MappingsOptimizer { if (updatedGlobalIdentifiers) { // Also keep a json file around for easier viewing writeJson(globalIdentifiersObject, MAPPINGS_DIR.resolve("identifier-table.json")); - - final Path outputPath = OUTPUT_DIR.resolve(OUTPUT_GLOBAL_IDENTIFIERS_FILE); - final CompoundTag globalIdentifiersTag = (CompoundTag) JsonConverter.toTag(globalIdentifiersObject); - write(globalIdentifiersTag, outputPath); - updatedGlobalIdentifiers = false; LOGGER.info("Updated global identifiers file"); } + + // Always create output file + final Path outputPath = OUTPUT_DIR.resolve(OUTPUT_GLOBAL_IDENTIFIERS_FILE); + final CompoundTag globalIdentifiersTag = (CompoundTag) JsonConverter.toTag(globalIdentifiersObject); + write(globalIdentifiersTag, outputPath); + updatedGlobalIdentifiers = false; } private static void addFileData(final String key, final int hash, final Path path) throws IOException { @@ -552,6 +553,7 @@ public final class MappingsOptimizer { } // Use the same compact storage on the identifier->global identifier files, just about halves the size + // TODO Omit mapped size? final MappingsResult result = MappingsLoader.map(identifiers, globalIdentifiersArray, null, errorStrategy); serialize(result, tag, key, true); }