diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/BlockItemPackets1_19.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/BlockItemPackets1_19.java index 74a4c698..409eb305 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/BlockItemPackets1_19.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/BlockItemPackets1_19.java @@ -25,6 +25,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.DataPalette; import com.viaversion.viaversion.api.minecraft.chunks.PaletteType; +import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper; import com.viaversion.viaversion.api.type.Type; @@ -51,7 +52,6 @@ public final class BlockItemPackets1_19 extends ItemRewriter { + final int size = wrapper.read(Type.VAR_INT); + wrapper.write(Type.UNSIGNED_BYTE, (short) size); + for (int i = 0; i < size; i++) { + handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // First item + handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); // Result + + final Item secondItem = wrapper.read(Type.FLAT_VAR_INT_ITEM); + if (secondItem != null) { + handleItemToClient(secondItem); + wrapper.write(Type.BOOLEAN, true); + wrapper.write(Type.FLAT_VAR_INT_ITEM, secondItem); + } else { + wrapper.write(Type.BOOLEAN, false); + } + + wrapper.passthrough(Type.BOOLEAN); // Out of stock + wrapper.passthrough(Type.INT); // Uses + wrapper.passthrough(Type.INT); // Max uses + wrapper.passthrough(Type.INT); // Xp + wrapper.passthrough(Type.INT); // Special price diff + wrapper.passthrough(Type.FLOAT); // Price multiplier + wrapper.passthrough(Type.INT); //Demand + } + }); + } + }); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_19.WINDOW_PROPERTY); protocol.registerClientbound(ClientboundPackets1_19.BLOCK_CHANGED_ACK, null, new PacketRemapper() {