mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-22 08:27:37 +01:00
Handle item name changes in trim material registry
This commit is contained in:
parent
82c55b1d78
commit
93e92ffc82
@ -59,6 +59,8 @@ public class RegistryDataRewriter {
|
||||
key = Key.stripMinecraftNamespace(key);
|
||||
if (key.equals("enchantment")) {
|
||||
updateEnchantments(entries);
|
||||
} else if (key.equals("trim_material")) {
|
||||
updateTrimMaterials(entries);
|
||||
}
|
||||
|
||||
final List<RegistryEntry> toAdd = this.toAdd.get(key);
|
||||
@ -126,6 +128,22 @@ public class RegistryDataRewriter {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateTrimMaterials(final RegistryEntry[] entries) {
|
||||
if (protocol.getMappingData().getFullItemMappings() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (final RegistryEntry entry : entries) {
|
||||
if (entry.tag() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final StringTag ingredientTag = ((CompoundTag) entry.tag()).getStringTag("ingredient");
|
||||
final String mappedIngredient = protocol.getMappingData().getFullItemMappings().mappedIdentifier(ingredientTag.getValue());
|
||||
ingredientTag.setValue(mappedIngredient);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateNestedEffect(final CompoundTag effectsTag) {
|
||||
final CompoundTag effect = effectsTag.getCompoundTag("effect");
|
||||
if (effect == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user