Polymer

Polymer

763k Downloads

Polymer Items invisible in Shulker Box tooltip and preview

borisshoes opened this issue ยท 1 comments

commented

Using a mod like tweakeroo to preview the items in a shulker box ends up having all polymer items invisible.

Would it be possible to mixin when sending the client a shulker box item data to replace the item ids of the polymer items in the box to their vanilla representations?

commented

The issue seems to also affect vanilla, as a shulker box containing only Polymer items will display 'Empty' in its tooltip.

This issue seems to be caused by Polymer only modifying the Items list, which works for bundles, not the BlockEntityTag.Items list:

if (itemStack.getNbt().contains("Items", NbtElement.LIST_TYPE)) {
var outList = new NbtList();
for (var itemNbt : itemStack.getNbt().getList("Items", NbtElement.COMPOUND_TYPE)) {
var base = new NbtCompound();
var slot = ((NbtCompound) itemNbt).get("Slot");
if (slot != null) {
base.put("Slot", slot);
}
outList.add(getPolymerItemStack(ItemStack.fromNbt((NbtCompound) itemNbt), tooltipContext, player).writeNbt(base));
}
out.getNbt().put("Items", outList);
}

If additional support is desired, note that the following fields can also contain item data, but are not displayed to the player in vanilla:

  • BlockEntityTag.RecordItem for jukeboxes
  • BlockEntityTag.Book for lecterns