Skip to content

Commit 4ca84f6

Browse files
committed
Fix <1.13 sounds for VB/VR
Technically unused in VV for now, but may also replace some in-code sound mappings later
1 parent 61c079a commit 4ca84f6

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ public void load() {
8383
final CompoundTag unmappedIdentifierData = readUnmappedIdentifiersFile("identifiers-" + unmappedVersion + ".nbt");
8484
final CompoundTag mappedIdentifierData = readMappedIdentifiersFile("identifiers-" + mappedVersion + ".nbt");
8585
if (unmappedIdentifierData != null && mappedIdentifierData != null) {
86-
itemMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "items");
87-
blockMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "blocks");
88-
soundMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "sounds");
86+
itemMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "items");
87+
blockMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "blocks");
88+
soundMappings = loadFullOrBiMappings(data, unmappedIdentifierData, mappedIdentifierData, "sounds");
89+
8990
entityMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "entities");
9091
argumentTypeMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "argumenttypes");
9192
recipeSerializerMappings = loadFullMappings(data, unmappedIdentifierData, mappedIdentifierData, "recipe_serializers");
@@ -105,8 +106,8 @@ public void load() {
105106
} else {
106107
// Might not have identifiers in older versions
107108
itemMappings = loadBiMappings(data, "items");
108-
soundMappings = loadMappings(data, "sounds");
109109
blockMappings = loadBiMappings(data, "blocks");
110+
soundMappings = loadMappings(data, "sounds");
110111
}
111112

112113
final CompoundTag tagsTag = data.getCompoundTag("tags");
@@ -145,6 +146,11 @@ public void load() {
145146
return MappingDataLoader.INSTANCE.loadMappings(data, key);
146147
}
147148

149+
protected @Nullable BiMappings loadFullOrBiMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
150+
final FullMappings mappings = loadFullMappings(data, unmappedIdentifiersTag, mappedIdentifiersTag, key);
151+
return mappings != null ? mappings : loadBiMappings(data, key);
152+
}
153+
148154
protected @Nullable FullMappings loadFullMappings(final CompoundTag data, final CompoundTag unmappedIdentifiersTag, final CompoundTag mappedIdentifiersTag, final String key) {
149155
if (!unmappedIdentifiersTag.contains(key) || !mappedIdentifiersTag.contains(key)) {
150156
return null;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)