mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-24 12:35:43 +01:00
Create tag if needed
This commit is contained in:
parent
fd85b67a92
commit
1b9d53af2a
@ -381,10 +381,11 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem
|
|||||||
if (customData != null) {
|
if (customData != null) {
|
||||||
// We later don't know which tags are custom data and which are not because the VV conversion
|
// We later don't know which tags are custom data and which are not because the VV conversion
|
||||||
// keeps converted data, so we backup the original custom data and restore it later
|
// keeps converted data, so we backup the original custom data and restore it later
|
||||||
|
if (oldItem.tag() == null) {
|
||||||
|
oldItem.setTag(new CompoundTag());
|
||||||
|
}
|
||||||
oldItem.tag().put(nbtTagName(), customData.copy());
|
oldItem.tag().put(nbtTagName(), customData.copy());
|
||||||
}
|
} else if (oldItem.tag() != null && oldItem.tag().isEmpty()) {
|
||||||
|
|
||||||
if (oldItem.tag() != null && oldItem.tag().isEmpty()) {
|
|
||||||
// Improve item equality checks by removing empty tags
|
// Improve item equality checks by removing empty tags
|
||||||
oldItem.setTag(null);
|
oldItem.setTag(null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user