feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MinecraftClient.Inventory.ItemPalettes;
|
|
|
|
|
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11;
|
|
|
|
|
|
|
|
|
|
public class KineticWeaponComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
|
|
|
|
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
|
|
|
|
{
|
|
|
|
|
public override void Parse(Queue<byte> data)
|
|
|
|
|
{
|
2026-03-24 01:16:05 +00:00
|
|
|
DataTypes.ReadNextVarInt(data); // contactCooldownTicks
|
|
|
|
|
DataTypes.ReadNextVarInt(data); // delayTicks
|
feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
ReadOptionalCondition(data); // dismountConditions
|
|
|
|
|
ReadOptionalCondition(data); // knockbackConditions
|
|
|
|
|
ReadOptionalCondition(data); // damageConditions
|
2026-03-24 01:16:05 +00:00
|
|
|
DataTypes.ReadNextFloat(data); // forwardMovement
|
|
|
|
|
DataTypes.ReadNextFloat(data); // damageMultiplier
|
feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
ReadOptionalSoundEventHolder(data); // sound
|
|
|
|
|
ReadOptionalSoundEventHolder(data); // hitSound
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ReadOptionalCondition(Queue<byte> data)
|
|
|
|
|
{
|
2026-03-24 01:16:05 +00:00
|
|
|
if (!DataTypes.ReadNextBool(data)) return;
|
|
|
|
|
DataTypes.ReadNextVarInt(data); // maxDurationTicks
|
|
|
|
|
DataTypes.ReadNextFloat(data); // minSpeed
|
|
|
|
|
DataTypes.ReadNextFloat(data); // minRelativeSpeed
|
feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ReadOptionalSoundEventHolder(Queue<byte> data)
|
|
|
|
|
{
|
2026-03-24 01:16:05 +00:00
|
|
|
if (!DataTypes.ReadNextBool(data)) return;
|
|
|
|
|
var holderId = DataTypes.ReadNextVarInt(data);
|
feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
if (holderId == 0)
|
|
|
|
|
{
|
2026-03-24 01:16:05 +00:00
|
|
|
DataTypes.ReadNextString(data);
|
|
|
|
|
if (DataTypes.ReadNextBool(data))
|
|
|
|
|
DataTypes.ReadNextFloat(data);
|
feat: add version routing, structured components, and metadata for MC 1.21.11
- Add MC_1_21_11_Version constant (protocol 774)
- Create StructuredComponentsRegistry12111 with 104 components (8 new:
use_effects, minimum_attack_charge, damage_type, attack_range,
piercing_weapon, kinetic_weapon, swing_animation, zombie_nautilus/variant)
- Add 6 new component classes for 1.21.11 wire formats
- Add RegistryEitherHolderComponent for holderRegistry-backed EitherHolder
- Add ZombieNautilusVariant and HumanoidArm cases in DataTypes.ReadNextMetadata
- Update all version routing in Protocol18, PacketType18Handler,
EntityMetadataPalette, StructuredComponentsHandler, and ProtocolHandler
- Bump MCHighestVersion to 1.21.11
Made-with: Cursor
2026-03-22 00:56:04 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Queue<byte> Serialize()
|
|
|
|
|
{
|
|
|
|
|
return new Queue<byte>();
|
|
|
|
|
}
|
|
|
|
|
}
|