Skip to content

Commit

Permalink
Hotfix item ids in 1.21 item hover events
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Aug 7, 2024
1 parent 9c2021b commit 55ea81f
Showing 1 changed file with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,13 @@ private void convertAttributeModifiersComponent(final CompoundTag tag) {
}
}

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
protected void handleShowItem(final UserConnection connection, final CompoundTag componentsTag) {
convertAttributeModifiersComponent(componentsTag);
handleContainerComponent(componentsTag);

TagUtil.removeNamespaced(componentsTag, "jukebox_playable");
protected void handleShowItem(final UserConnection connection, final CompoundTag itemTag, final CompoundTag componentsTag) {
super.handleShowItem(connection, itemTag, componentsTag);
if (componentsTag != null) {
TagUtil.removeNamespaced(componentsTag, "jukebox_playable");
convertAttributeModifiersComponent(componentsTag);
}
}

@Override
Expand Down

0 comments on commit 55ea81f

Please sign in to comment.