From f2c816df72c01ac35e9a7a9deed4b55ddd55b921 Mon Sep 17 00:00:00 2001 From: EnZaXD <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 24 Mar 2024 12:14:42 +0100 Subject: [PATCH] Add mapped and unmapped identifier read method (#3756) --- .../viaversion/api/data/MappingDataBase.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java b/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java index 74daf6002..dd8a6c48a 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java +++ b/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java @@ -82,8 +82,8 @@ public class MappingDataBase implements MappingData { attributeMappings = loadMappings(data, "attributes"); itemMappings = loadBiMappings(data, "items"); - final CompoundTag unmappedIdentifierData = readIdentifiersFile("identifiers-" + unmappedVersion + ".nbt"); - final CompoundTag mappedIdentifierData = readIdentifiersFile("identifiers-" + mappedVersion + ".nbt"); + final CompoundTag unmappedIdentifierData = readUnmappedIdentifiersFile("identifiers-" + unmappedVersion + ".nbt"); + final CompoundTag mappedIdentifierData = readMappedIdentifiersFile("identifiers-" + mappedVersion + ".nbt"); if (unmappedIdentifierData != null && mappedIdentifierData != null) { entityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "entities"); argumentTypeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "argumenttypes"); @@ -118,7 +118,11 @@ public class MappingDataBase implements MappingData { return MappingDataLoader.INSTANCE.loadNBT(name); } - protected @Nullable CompoundTag readIdentifiersFile(final String name) { + protected @Nullable CompoundTag readUnmappedIdentifiersFile(final String name) { + return MappingDataLoader.INSTANCE.loadNBT(name, true); + } + + protected @Nullable CompoundTag readMappedIdentifiersFile(final String name) { return MappingDataLoader.INSTANCE.loadNBT(name, true); }