Minecraft-Console-Client/MinecraftClient/Protocol/Handlers/StructuredComponents/Components/26_2/SulfurCubeContentComponent262.cs
Reed Pennock 22685a720c feat: Add MC 26.2 palettes, registries and new sulfur/cinnabar content
Generated from the 26.2 server data reports (registries.json / blocks.json):
- ItemPalette262 (1537 items, 31 new; IDs shifted by early sulfur/cinnabar inserts)
- Palette262 blocks (1196 blocks, 32366 states, 28 new)
- EntityPalette262 (158 entities, new sulfur_cube)
- StructuredComponentsRegistry262 with new sulfur_cube_content component
  at ID 78 (shifts IDs 78-109 up by one); wire format is one ItemStackTemplate
- New ItemType/Material/EntityType enum entries for the sulfur and
  cinnabar families, MusicDiscBounce, SulfurSpike and SulfurCube

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 16:43:20 -05:00

25 lines
989 B
C#

using System.Collections.Generic;
using MinecraftClient.Inventory;
using MinecraftClient.Inventory.ItemPalettes;
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._26_2;
public class SulfurCubeContentComponent262(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
{
public Item? AbsorbedBlockItemStack { get; set; }
public override void Parse(Queue<byte> data)
{
AbsorbedBlockItemStack = DataTypes.ReadNextItemStackTemplate(data, ItemPalette);
}
public override Queue<byte> Serialize()
{
var data = new List<byte>();
if (AbsorbedBlockItemStack is not null && !AbsorbedBlockItemStack.IsEmpty)
data.AddRange(DataTypes.GetItemStackTemplate(AbsorbedBlockItemStack, ItemPalette));
return new Queue<byte>(data);
}
}