2024-09-11 20:35:23 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MinecraftClient.Inventory.ItemPalettes;
|
|
|
|
|
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6;
|
|
|
|
|
|
2024-10-05 13:37:52 +02:00
|
|
|
public class EntityDataComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
2024-09-11 20:35:23 +02:00
|
|
|
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
|
|
|
|
{
|
2024-10-05 13:37:52 +02:00
|
|
|
public Dictionary<string, object>? Nbt { get; set; }
|
2024-09-11 20:35:23 +02:00
|
|
|
|
|
|
|
|
public override void Parse(Queue<byte> data)
|
|
|
|
|
{
|
|
|
|
|
Nbt = dataTypes.ReadNextNbt(data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Queue<byte> Serialize()
|
|
|
|
|
{
|
|
|
|
|
var data = new List<byte>();
|
|
|
|
|
data.AddRange(DataTypes.GetNbt(Nbt));
|
|
|
|
|
return new Queue<byte>(data);
|
|
|
|
|
}
|
2024-10-05 13:37:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BucketEntityDataComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
|
|
|
|
: EntityDataComponent(dataTypes, itemPalette, subComponentRegistry) {}
|
|
|
|
|
|
|
|
|
|
public class BlockEntityDataComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
|
|
|
|
: EntityDataComponent(dataTypes, itemPalette, subComponentRegistry) {}
|