using System.Collections.Generic; using MinecraftClient.Inventory; using MinecraftClient.Inventory.ItemPalettes; using MinecraftClient.Protocol.Handlers.StructuredComponents.Core; namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_2; public class UseRemainderComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry) : StructuredComponent(dataTypes, itemPalette, subComponentRegistry) { public Item? ConvertInto { get; set; } public override void Parse(Queue data) { ConvertInto = DataTypes.ReadNextItemSlot(data, ItemPalette); } public override Queue Serialize() { var data = new List(); data.AddRange(DataTypes.GetItemSlot(ConvertInto, ItemPalette)); return new Queue(data); } }