Skip to content

Commit 50e7c15

Browse files
committed
Fix wolf_variant tracking in 1.21.5->1.21.4
1 parent ef004cf commit 50e7c15

1 file changed

Lines changed: 13 additions & 21 deletions

File tree

common/src/main/java/com/viaversion/viabackwards/protocol/v1_21_5to1_21_4/rewriter/RegistryDataRewriter1_21_5.java

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,23 @@ public RegistryEntry[] handle(final UserConnection connection, final String key,
4343
final boolean trimPatternRegistry = key.equals("trim_pattern");
4444
if (trimPatternRegistry || key.equals("trim_material")) {
4545
updateTrim(entries, trimPatternRegistry ? "template_item" : "ingredient");
46-
return super.handle(connection, key, entries);
47-
}
48-
49-
if (key.equals("enchantment")) {
46+
} else if (key.equals("enchantment")) {
5047
updateEnchantment(entries);
51-
return super.handle(connection, key, entries);
52-
}
53-
54-
if (!key.equals("wolf_variant")) {
55-
return super.handle(connection, key, entries);
56-
}
48+
} else if (key.equals("wolf_variant")) {
49+
for (final RegistryEntry entry : entries) {
50+
if (entry.tag() == null) {
51+
continue;
52+
}
5753

58-
for (final RegistryEntry entry : entries) {
59-
if (entry.tag() == null) {
60-
continue;
54+
final CompoundTag variant = (CompoundTag) entry.tag();
55+
final CompoundTag assets = (CompoundTag) variant.remove("assets");
56+
variant.put("wild_texture", assets.get("wild"));
57+
variant.put("tame_texture", assets.get("tame"));
58+
variant.put("angry_texture", assets.get("angry"));
59+
variant.put("biomes", new ListTag<>(StringTag.class));
6160
}
62-
63-
final CompoundTag variant = (CompoundTag) entry.tag();
64-
final CompoundTag assets = (CompoundTag) variant.remove("assets");
65-
variant.put("wild_texture", assets.get("wild"));
66-
variant.put("tame_texture", assets.get("tame"));
67-
variant.put("angry_texture", assets.get("angry"));
68-
variant.put("biomes", new ListTag<>(StringTag.class));
6961
}
70-
return entries;
62+
return super.handle(connection, key, entries);
7163
}
7264

7365
private void updateTrim(final RegistryEntry[] entries, final String itemKey) {

0 commit comments

Comments
 (0)