diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/data/EntityMappings1_11.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/data/EntityMappings1_11.java index 44e8d4660..ae23057e0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/data/EntityMappings1_11.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/data/EntityMappings1_11.java @@ -144,7 +144,6 @@ public class EntityMappings1_11 { if (hasEntityTag(item)) { toClient(item.tag().getCompoundTag("EntityTag"), backwards); } - if (item != null && item.amount() <= 0) item.setAmount(1); } public static void toServerItem(Item item) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/rewriter/ItemPacketRewriter1_11.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/rewriter/ItemPacketRewriter1_11.java index 489c8c286..c305288f6 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/rewriter/ItemPacketRewriter1_11.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_10to1_11/rewriter/ItemPacketRewriter1_11.java @@ -17,6 +17,8 @@ */ package com.viaversion.viaversion.protocols.v1_10to1_11.rewriter; +import com.viaversion.nbt.tag.ByteTag; +import com.viaversion.nbt.tag.CompoundTag; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; @@ -74,14 +76,30 @@ public class ItemPacketRewriter1_11 extends ItemRewriterremoveUnchecked(nbtTagName()).asByte()); + if (item.tag().isEmpty()) { + item.setTag(null); + } + } EntityMappings1_11.toServerItem(item); - if (item == null) return null; boolean newItem = item.identifier() >= 218 && item.identifier() <= 234; newItem |= item.identifier() == 449 || item.identifier() == 450; if (newItem) { // Replace server-side unknown items