3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-09-28 06:31:06 +02:00

Hotfix item ids in 1.21 item hover events

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-08-07 17:37:24 +02:00
Ursprung 9c2021b947
Commit 55ea81f9c7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -52,28 +52,13 @@ public final class ComponentRewriter1_21 extends TranslatableRewriter<Clientboun
} }
} }
private void handleContainerComponent(final CompoundTag tag) {
final ListTag<CompoundTag> container = TagUtil.getNamespacedCompoundTagList(tag, "container");
if (container == null) {
return;
}
for (final CompoundTag entryTag : container) {
final CompoundTag itemTag = entryTag.getCompoundTag("item");
final CompoundTag componentsTag = itemTag.getCompoundTag("components");
if (componentsTag != null) {
convertAttributeModifiersComponent(componentsTag);
handleContainerComponent(componentsTag);
}
}
}
@Override @Override
protected void handleShowItem(final UserConnection connection, final CompoundTag componentsTag) { protected void handleShowItem(final UserConnection connection, final CompoundTag itemTag, final CompoundTag componentsTag) {
convertAttributeModifiersComponent(componentsTag); super.handleShowItem(connection, itemTag, componentsTag);
handleContainerComponent(componentsTag); if (componentsTag != null) {
TagUtil.removeNamespaced(componentsTag, "jukebox_playable"); TagUtil.removeNamespaced(componentsTag, "jukebox_playable");
convertAttributeModifiersComponent(componentsTag);
}
} }
@Override @Override