Remove empty item tags

Fixes #752
This commit is contained in:
Nassim Jahnke 2024-05-21 11:20:55 +02:00
parent a9ed655d95
commit d7f550fc4f
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 8 additions and 4 deletions

View File

@ -319,7 +319,13 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem
if (item == null) return null;
super.handleItemToClient(connection, item);
return vvProtocol.getItemRewriter().toOldItem(connection, item, DATA_CONVERTER);
final Item oldItem = vvProtocol.getItemRewriter().toOldItem(connection, item, DATA_CONVERTER);
if (oldItem.tag() != null && oldItem.tag().isEmpty()) {
// Improve item equality checks by removing empty tags
oldItem.setTag(null);
}
return oldItem;
}
@Override

View File

@ -70,9 +70,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
do {
slot = wrapper.read(Types.BYTE);
if (slot == 6) {
//TODO
// Body to... something else? the actual inventory slot is still broken for llamas
// Incoming click also needs to be fixed
//TODO Body to... something else?
slot = 2;
}