mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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
This commit is contained in:
parent
50b4b3c8fe
commit
6c36dc341a
14 changed files with 361 additions and 12 deletions
|
|
@ -26,6 +26,7 @@ public abstract class EntityMetadataPalette
|
|||
<= Protocol18Handler.MC_1_21_4_Version => new EntityMetadataPalette1206(), // 1.20.6 - 1.21.4
|
||||
<= Protocol18Handler.MC_1_21_7_Version => new EntityMetadataPalette1215(), // 1.21.5 - 1.21.8
|
||||
<= Protocol18Handler.MC_1_21_9_Version => new EntityMetadataPalette1219(), // 1.21.9 - 1.21.10
|
||||
<= Protocol18Handler.MC_1_21_11_Version => new EntityMetadataPalette12111(), // 1.21.11
|
||||
_ => throw new NotImplementedException()
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace MinecraftClient
|
|||
|
||||
public const string Version = MCHighestVersion;
|
||||
public const string MCLowestVersion = "1.4.6";
|
||||
public const string MCHighestVersion = "1.21.10";
|
||||
public const string MCHighestVersion = "1.21.11";
|
||||
public static readonly string? BuildInfo = null;
|
||||
|
||||
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
|
||||
|
|
|
|||
|
|
@ -932,6 +932,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case EntityMetaDataType.WeatheringCopperState: // Weathering Copper state (1.21.9+)
|
||||
value = ReadNextVarInt(cache);
|
||||
break;
|
||||
case EntityMetaDataType.ZombieNautilusVariant: // ZombieNautilus Variant (1.21.11+)
|
||||
case EntityMetaDataType.HumanoidArm: // Humanoid Arm (1.21.11+)
|
||||
value = ReadNextVarInt(cache);
|
||||
break;
|
||||
case EntityMetaDataType.ResolvableProfile: // ResolvableProfile (1.21.9+)
|
||||
ReadNextResolvableProfile(cache);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
PacketTypePalette p = protocol switch
|
||||
{
|
||||
> Protocol18Handler.MC_1_21_9_Version => throw new NotImplementedException(Translations
|
||||
> Protocol18Handler.MC_1_21_11_Version => throw new NotImplementedException(Translations
|
||||
.exception_palette_packet),
|
||||
<= Protocol18Handler.MC_1_21_9_Version and > Protocol18Handler.MC_1_21_7_Version => new PacketPalette1219(),
|
||||
<= Protocol18Handler.MC_1_21_11_Version and > Protocol18Handler.MC_1_21_7_Version => new PacketPalette1219(),
|
||||
<= Protocol18Handler.MC_1_21_7_Version and > Protocol18Handler.MC_1_21_5_Version => new PacketPalette1216(),
|
||||
<= Protocol18Handler.MC_1_21_5_Version and > Protocol18Handler.MC_1_21_4_Version => new PacketPalette1215(),
|
||||
<= Protocol18Handler.MC_1_21_4_Version and > Protocol18Handler.MC_1_21_2_Version => new PacketPalette1214(),
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
internal const int MC_1_21_6_Version = 771;
|
||||
internal const int MC_1_21_7_Version = 772;
|
||||
internal const int MC_1_21_9_Version = 773;
|
||||
internal const int MC_1_21_11_Version = 774;
|
||||
|
||||
private int compression_treshold = -1;
|
||||
private int autocomplete_transaction_id = 0;
|
||||
|
|
@ -130,21 +131,21 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
lastSeenMessagesCollector = protocolVersion >= MC_1_19_3_Version ? new(20) : new(5);
|
||||
chunkBatchStartTime = GetNanos();
|
||||
|
||||
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_9_Version)
|
||||
if (handler.GetTerrainEnabled() && protocolVersion > MC_1_21_11_Version)
|
||||
{
|
||||
log.Error($"§c{Translations.extra_terrainandmovement_disabled}");
|
||||
handler.SetTerrainEnabled(false);
|
||||
}
|
||||
|
||||
if (handler.GetInventoryEnabled() &&
|
||||
protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version)
|
||||
protocolVersion is < MC_1_8_Version or > MC_1_21_11_Version)
|
||||
{
|
||||
log.Error($"§c{Translations.extra_inventory_disabled}");
|
||||
handler.SetInventoryEnabled(false);
|
||||
}
|
||||
|
||||
if (handler.GetEntityHandlingEnabled() &&
|
||||
protocolVersion is < MC_1_8_Version or > MC_1_21_9_Version)
|
||||
protocolVersion is < MC_1_8_Version or > MC_1_21_11_Version)
|
||||
{
|
||||
log.Error($"§c{Translations.extra_entity_disabled}");
|
||||
handler.SetEntityHandlingEnabled(false);
|
||||
|
|
@ -153,7 +154,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
Block.Palette = protocolVersion switch
|
||||
{
|
||||
// Block palette
|
||||
> MC_1_21_9_Version when handler.GetTerrainEnabled() =>
|
||||
> MC_1_21_11_Version when handler.GetTerrainEnabled() =>
|
||||
throw new NotImplementedException(Translations.exception_palette_block),
|
||||
>= MC_1_21_9_Version => new Palette1219(),
|
||||
>= MC_1_21_6_Version => new Palette1216(), // 1.21.7/1.21.8 blocks unchanged, reuse 1216
|
||||
|
|
@ -177,8 +178,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
entityPalette = protocolVersion switch
|
||||
{
|
||||
// Entity palette
|
||||
> MC_1_21_9_Version when handler.GetEntityHandlingEnabled() =>
|
||||
> MC_1_21_11_Version when handler.GetEntityHandlingEnabled() =>
|
||||
throw new NotImplementedException(Translations.exception_palette_entity),
|
||||
>= MC_1_21_11_Version => new EntityPalette12111(),
|
||||
>= MC_1_21_9_Version => new EntityPalette1219(),
|
||||
>= MC_1_21_6_Version => new EntityPalette1216(), // 1.21.7/1.21.8 entities unchanged, reuse 1216
|
||||
>= MC_1_21_5_Version => new EntityPalette1215(),
|
||||
|
|
@ -205,8 +207,9 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
itemPalette = protocolVersion switch
|
||||
{
|
||||
// Item palette
|
||||
> MC_1_21_9_Version when handler.GetInventoryEnabled() =>
|
||||
> MC_1_21_11_Version when handler.GetInventoryEnabled() =>
|
||||
throw new NotImplementedException(Translations.exception_palette_item),
|
||||
>= MC_1_21_11_Version => new ItemPalette12111(),
|
||||
>= MC_1_21_9_Version => new ItemPalette1219(),
|
||||
>= MC_1_21_7_Version => new ItemPalette1217(),
|
||||
>= MC_1_21_6_Version => new ItemPalette1216(),
|
||||
|
|
@ -2665,7 +2668,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// Also make a palette for field? Will be a lot of work
|
||||
var healthField = protocolVersion switch
|
||||
{
|
||||
> MC_1_21_9_Version => throw new NotImplementedException(Translations
|
||||
> MC_1_21_11_Version => throw new NotImplementedException(Translations
|
||||
.exception_palette_healthfield),
|
||||
// 1.17 and above
|
||||
>= MC_1_17_Version => 9,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
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 AttackRangeComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public float MinRange { get; set; }
|
||||
public float MaxRange { get; set; }
|
||||
public float MinCreativeRange { get; set; }
|
||||
public float MaxCreativeRange { get; set; }
|
||||
public float HitboxMargin { get; set; }
|
||||
public float MobFactor { get; set; }
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
MinRange = dataTypes.ReadNextFloat(data);
|
||||
MaxRange = dataTypes.ReadNextFloat(data);
|
||||
MinCreativeRange = dataTypes.ReadNextFloat(data);
|
||||
MaxCreativeRange = dataTypes.ReadNextFloat(data);
|
||||
HitboxMargin = dataTypes.ReadNextFloat(data);
|
||||
MobFactor = dataTypes.ReadNextFloat(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
bytes.AddRange(DataTypes.GetFloat(MinRange));
|
||||
bytes.AddRange(DataTypes.GetFloat(MaxRange));
|
||||
bytes.AddRange(DataTypes.GetFloat(MinCreativeRange));
|
||||
bytes.AddRange(DataTypes.GetFloat(MaxCreativeRange));
|
||||
bytes.AddRange(DataTypes.GetFloat(HitboxMargin));
|
||||
bytes.AddRange(DataTypes.GetFloat(MobFactor));
|
||||
return new Queue<byte>(bytes);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
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)
|
||||
{
|
||||
dataTypes.ReadNextVarInt(data); // contactCooldownTicks
|
||||
dataTypes.ReadNextVarInt(data); // delayTicks
|
||||
ReadOptionalCondition(data); // dismountConditions
|
||||
ReadOptionalCondition(data); // knockbackConditions
|
||||
ReadOptionalCondition(data); // damageConditions
|
||||
dataTypes.ReadNextFloat(data); // forwardMovement
|
||||
dataTypes.ReadNextFloat(data); // damageMultiplier
|
||||
ReadOptionalSoundEventHolder(data); // sound
|
||||
ReadOptionalSoundEventHolder(data); // hitSound
|
||||
}
|
||||
|
||||
private void ReadOptionalCondition(Queue<byte> data)
|
||||
{
|
||||
if (!dataTypes.ReadNextBool(data)) return;
|
||||
dataTypes.ReadNextVarInt(data); // maxDurationTicks
|
||||
dataTypes.ReadNextFloat(data); // minSpeed
|
||||
dataTypes.ReadNextFloat(data); // minRelativeSpeed
|
||||
}
|
||||
|
||||
private void ReadOptionalSoundEventHolder(Queue<byte> data)
|
||||
{
|
||||
if (!dataTypes.ReadNextBool(data)) return;
|
||||
var holderId = dataTypes.ReadNextVarInt(data);
|
||||
if (holderId == 0)
|
||||
{
|
||||
dataTypes.ReadNextString(data);
|
||||
if (dataTypes.ReadNextBool(data))
|
||||
dataTypes.ReadNextFloat(data);
|
||||
}
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
return new Queue<byte>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
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 PiercingWeaponComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public bool DealsKnockback { get; set; }
|
||||
public bool Dismounts { get; set; }
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
DealsKnockback = dataTypes.ReadNextBool(data);
|
||||
Dismounts = dataTypes.ReadNextBool(data);
|
||||
ReadOptionalSoundEventHolder(data);
|
||||
ReadOptionalSoundEventHolder(data);
|
||||
}
|
||||
|
||||
private void ReadOptionalSoundEventHolder(Queue<byte> data)
|
||||
{
|
||||
if (!dataTypes.ReadNextBool(data)) return;
|
||||
var holderId = dataTypes.ReadNextVarInt(data);
|
||||
if (holderId == 0)
|
||||
{
|
||||
dataTypes.ReadNextString(data);
|
||||
if (dataTypes.ReadNextBool(data))
|
||||
dataTypes.ReadNextFloat(data);
|
||||
}
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
return new Queue<byte>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Collections.Generic;
|
||||
using MinecraftClient.Inventory.ItemPalettes;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
||||
|
||||
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11;
|
||||
|
||||
/// <summary>
|
||||
/// EitherHolder backed by holderRegistry (VarInt = raw registry ID, 0 is valid).
|
||||
/// Used for DamageType and ZombieNautilusVariant where the holder codec is holderRegistry(),
|
||||
/// unlike the holder() codec used in SoundEvent (where 0 means inline).
|
||||
/// </summary>
|
||||
public class RegistryEitherHolderComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public bool IsHolder { get; set; }
|
||||
public int HolderId { get; set; }
|
||||
public string? ResourceKey { get; set; }
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
IsHolder = dataTypes.ReadNextBool(data);
|
||||
if (IsHolder)
|
||||
HolderId = dataTypes.ReadNextVarInt(data);
|
||||
else
|
||||
ResourceKey = dataTypes.ReadNextString(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
bytes.AddRange(DataTypes.GetBool(IsHolder));
|
||||
if (IsHolder)
|
||||
bytes.AddRange(DataTypes.GetVarInt(HolderId));
|
||||
else
|
||||
bytes.AddRange(DataTypes.GetString(ResourceKey ?? ""));
|
||||
return new Queue<byte>(bytes);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
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 SwingAnimationComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public int AnimationType { get; set; }
|
||||
public int Duration { get; set; }
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
AnimationType = dataTypes.ReadNextVarInt(data);
|
||||
Duration = dataTypes.ReadNextVarInt(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
bytes.AddRange(DataTypes.GetVarInt(AnimationType));
|
||||
bytes.AddRange(DataTypes.GetVarInt(Duration));
|
||||
return new Queue<byte>(bytes);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
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 UseEffectsComponent(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: StructuredComponent(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
public bool CanSprint { get; set; }
|
||||
public bool InteractVibrations { get; set; }
|
||||
public float SpeedMultiplier { get; set; }
|
||||
|
||||
public override void Parse(Queue<byte> data)
|
||||
{
|
||||
CanSprint = dataTypes.ReadNextBool(data);
|
||||
InteractVibrations = dataTypes.ReadNextBool(data);
|
||||
SpeedMultiplier = dataTypes.ReadNextFloat(data);
|
||||
}
|
||||
|
||||
public override Queue<byte> Serialize()
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
bytes.AddRange(DataTypes.GetBool(CanSprint));
|
||||
bytes.AddRange(DataTypes.GetBool(InteractVibrations));
|
||||
bytes.AddRange(DataTypes.GetFloat(SpeedMultiplier));
|
||||
return new Queue<byte>(bytes);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
using MinecraftClient.Inventory.ItemPalettes;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_20_6;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_2;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_5;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Components._1_21_11;
|
||||
using MinecraftClient.Protocol.Handlers.StructuredComponents.Core;
|
||||
|
||||
namespace MinecraftClient.Protocol.Handlers.StructuredComponents.Registries;
|
||||
|
||||
public class StructuredComponentsRegistry12111 : StructuredComponentRegistry
|
||||
{
|
||||
public StructuredComponentsRegistry12111(DataTypes dataTypes, ItemPalette itemPalette, SubComponentRegistry subComponentRegistry)
|
||||
: base(dataTypes, itemPalette, subComponentRegistry)
|
||||
{
|
||||
RegisterComponent<CustomDataComponent>(0, "minecraft:custom_data");
|
||||
RegisterComponent<MaxStackSizeComponent>(1, "minecraft:max_stack_size");
|
||||
RegisterComponent<MaxDamageComponent>(2, "minecraft:max_damage");
|
||||
RegisterComponent<DamageComponent>(3, "minecraft:damage");
|
||||
RegisterComponent<EmptyComponent>(4, "minecraft:unbreakable");
|
||||
RegisterComponent<UseEffectsComponent>(5, "minecraft:use_effects");
|
||||
RegisterComponent<CustomNameComponent>(6, "minecraft:custom_name");
|
||||
RegisterComponent<PotionDurationScaleComponent>(7, "minecraft:minimum_attack_charge");
|
||||
RegisterComponent<RegistryEitherHolderComponent>(8, "minecraft:damage_type");
|
||||
RegisterComponent<ItemNameComponent>(9, "minecraft:item_name");
|
||||
RegisterComponent<ItemModelComponent>(10, "minecraft:item_model");
|
||||
RegisterComponent<LoreNameComponent1206>(11, "minecraft:lore");
|
||||
RegisterComponent<RarityComponent>(12, "minecraft:rarity");
|
||||
RegisterComponent<EnchantmentsComponent>(13, "minecraft:enchantments");
|
||||
RegisterComponent<CanPlaceOnComponent>(14, "minecraft:can_place_on");
|
||||
RegisterComponent<CanBreakComponent>(15, "minecraft:can_break");
|
||||
RegisterComponent<AttributeModifiersComponent>(16, "minecraft:attribute_modifiers");
|
||||
RegisterComponent<CustomModelDataComponent>(17, "minecraft:custom_model_data");
|
||||
RegisterComponent<TooltipDisplayComponent>(18, "minecraft:tooltip_display");
|
||||
RegisterComponent<RepairCostComponent>(19, "minecraft:repair_cost");
|
||||
RegisterComponent<CreativeSlotLockComponent>(20, "minecraft:creative_slot_lock");
|
||||
RegisterComponent<EnchantmentGlintOverrideComponent>(21, "minecraft:enchantment_glint_override");
|
||||
RegisterComponent<IntangibleProjectileComponent>(22, "minecraft:intangible_projectile");
|
||||
RegisterComponent<FoodComponent1212>(23, "minecraft:food");
|
||||
RegisterComponent<ConsumableComponent>(24, "minecraft:consumable");
|
||||
RegisterComponent<UseRemainderComponent>(25, "minecraft:use_remainder");
|
||||
RegisterComponent<UseCooldownComponent>(26, "minecraft:use_cooldown");
|
||||
RegisterComponent<DamageResistantComponent>(27, "minecraft:damage_resistant");
|
||||
RegisterComponent<ToolComponent>(28, "minecraft:tool");
|
||||
RegisterComponent<WeaponComponent>(29, "minecraft:weapon");
|
||||
RegisterComponent<AttackRangeComponent>(30, "minecraft:attack_range");
|
||||
RegisterComponent<EnchantableComponent>(31, "minecraft:enchantable");
|
||||
RegisterComponent<EquippableComponent>(32, "minecraft:equippable");
|
||||
RegisterComponent<RepairableComponent>(33, "minecraft:repairable");
|
||||
RegisterComponent<GliderComponent>(34, "minecraft:glider");
|
||||
RegisterComponent<TooltipStyleComponent>(35, "minecraft:tooltip_style");
|
||||
RegisterComponent<DeathProtectionComponent>(36, "minecraft:death_protection");
|
||||
RegisterComponent<BlocksAttacksComponent>(37, "minecraft:blocks_attacks");
|
||||
RegisterComponent<PiercingWeaponComponent>(38, "minecraft:piercing_weapon");
|
||||
RegisterComponent<KineticWeaponComponent>(39, "minecraft:kinetic_weapon");
|
||||
RegisterComponent<SwingAnimationComponent>(40, "minecraft:swing_animation");
|
||||
RegisterComponent<StoredEnchantmentsComponent>(41, "minecraft:stored_enchantments");
|
||||
RegisterComponent<DyeColorComponent>(42, "minecraft:dyed_color");
|
||||
RegisterComponent<MapColorComponent>(43, "minecraft:map_color");
|
||||
RegisterComponent<MapIdComponent>(44, "minecraft:map_id");
|
||||
RegisterComponent<MapDecorationsComponent>(45, "minecraft:map_decorations");
|
||||
RegisterComponent<MapPostProcessingComponent>(46, "minecraft:map_post_processing");
|
||||
RegisterComponent<ChargedProjectilesComponent>(47, "minecraft:charged_projectiles");
|
||||
RegisterComponent<BundleContentsComponent>(48, "minecraft:bundle_contents");
|
||||
RegisterComponent<PotionContentsComponent>(49, "minecraft:potion_contents");
|
||||
RegisterComponent<PotionDurationScaleComponent>(50, "minecraft:potion_duration_scale");
|
||||
RegisterComponent<SuspiciousStewEffectsComponent>(51, "minecraft:suspicious_stew_effects");
|
||||
RegisterComponent<WritableBlookContentComponent>(52, "minecraft:writable_book_content");
|
||||
RegisterComponent<WrittenBlookContentComponent>(53, "minecraft:written_book_content");
|
||||
RegisterComponent<TrimComponent>(54, "minecraft:trim");
|
||||
RegisterComponent<DebugStickStateComponent>(55, "minecraft:debug_stick_state");
|
||||
RegisterComponent<EntityDataComponent>(56, "minecraft:entity_data");
|
||||
RegisterComponent<BucketEntityDataComponent>(57, "minecraft:bucket_entity_data");
|
||||
RegisterComponent<BlockEntityDataComponent>(58, "minecraft:block_entity_data");
|
||||
RegisterComponent<InstrumentComponent1215>(59, "minecraft:instrument");
|
||||
RegisterComponent<ProvidesTrimMaterialComponent>(60, "minecraft:provides_trim_material");
|
||||
RegisterComponent<OmniousBottleAmplifierComponent>(61, "minecraft:ominous_bottle_amplifier");
|
||||
RegisterComponent<JukeBoxPlayableComponent>(62, "minecraft:jukebox_playable");
|
||||
RegisterComponent<ProvidesBannerPatternsComponent>(63, "minecraft:provides_banner_patterns");
|
||||
RegisterComponent<RecipesComponent>(64, "minecraft:recipes");
|
||||
RegisterComponent<LodestoneTrackerComponent>(65, "minecraft:lodestone_tracker");
|
||||
RegisterComponent<FireworkExplosionComponent>(66, "minecraft:firework_explosion");
|
||||
RegisterComponent<FireworksComponent>(67, "minecraft:fireworks");
|
||||
RegisterComponent<ProfileComponent>(68, "minecraft:profile");
|
||||
RegisterComponent<NoteBlockSoundComponent>(69, "minecraft:note_block_sound");
|
||||
RegisterComponent<BannerPatternsComponent>(70, "minecraft:banner_patterns");
|
||||
RegisterComponent<BaseColorComponent>(71, "minecraft:base_color");
|
||||
RegisterComponent<PotDecorationsComponent>(72, "minecraft:pot_decorations");
|
||||
RegisterComponent<ContainerComponent>(73, "minecraft:container");
|
||||
RegisterComponent<BlockStateComponent>(74, "minecraft:block_state");
|
||||
RegisterComponent<BeesComponent>(75, "minecraft:bees");
|
||||
RegisterComponent<LockComponent>(76, "minecraft:lock");
|
||||
RegisterComponent<ContainerLootComponent>(77, "minecraft:container_loot");
|
||||
|
||||
RegisterComponent<SoundEventHolderComponent>(78, "minecraft:break_sound");
|
||||
RegisterComponent<VarIntComponent>(79, "minecraft:villager/variant");
|
||||
RegisterComponent<VarIntComponent>(80, "minecraft:wolf/variant");
|
||||
RegisterComponent<VarIntComponent>(81, "minecraft:wolf/sound_variant");
|
||||
RegisterComponent<VarIntComponent>(82, "minecraft:wolf/collar");
|
||||
RegisterComponent<VarIntComponent>(83, "minecraft:fox/variant");
|
||||
RegisterComponent<VarIntComponent>(84, "minecraft:salmon/size");
|
||||
RegisterComponent<VarIntComponent>(85, "minecraft:parrot/variant");
|
||||
RegisterComponent<VarIntComponent>(86, "minecraft:tropical_fish/pattern");
|
||||
RegisterComponent<VarIntComponent>(87, "minecraft:tropical_fish/base_color");
|
||||
RegisterComponent<VarIntComponent>(88, "minecraft:tropical_fish/pattern_color");
|
||||
RegisterComponent<VarIntComponent>(89, "minecraft:mooshroom/variant");
|
||||
RegisterComponent<VarIntComponent>(90, "minecraft:rabbit/variant");
|
||||
RegisterComponent<VarIntComponent>(91, "minecraft:pig/variant");
|
||||
RegisterComponent<VarIntComponent>(92, "minecraft:cow/variant");
|
||||
RegisterComponent<EitherHolderComponent>(93, "minecraft:chicken/variant");
|
||||
RegisterComponent<RegistryEitherHolderComponent>(94, "minecraft:zombie_nautilus/variant");
|
||||
RegisterComponent<VarIntComponent>(95, "minecraft:frog/variant");
|
||||
RegisterComponent<VarIntComponent>(96, "minecraft:horse/variant");
|
||||
RegisterComponent<PaintingVariantHolderComponent>(97, "minecraft:painting/variant");
|
||||
RegisterComponent<VarIntComponent>(98, "minecraft:llama/variant");
|
||||
RegisterComponent<VarIntComponent>(99, "minecraft:axolotl/variant");
|
||||
RegisterComponent<VarIntComponent>(100, "minecraft:cat/variant");
|
||||
RegisterComponent<VarIntComponent>(101, "minecraft:cat/collar");
|
||||
RegisterComponent<VarIntComponent>(102, "minecraft:sheep/color");
|
||||
RegisterComponent<VarIntComponent>(103, "minecraft:shulker/color");
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,6 @@ public class StructuredComponentsHandler
|
|||
{
|
||||
Protocol18Handler.MC_1_20_6_Version => typeof(SubComponentRegistry1206),
|
||||
Protocol18Handler.MC_1_21_Version => typeof(SubComponentRegistry121),
|
||||
>= Protocol18Handler.MC_1_21_5_Version => typeof(SubComponentRegistry1212),
|
||||
>= Protocol18Handler.MC_1_21_2_Version => typeof(SubComponentRegistry1212),
|
||||
_ => throw new NotSupportedException($"Protocol version {protocolVersion} is not supported for subcomponent registries!")
|
||||
};
|
||||
|
|
@ -34,6 +33,7 @@ public class StructuredComponentsHandler
|
|||
{
|
||||
Protocol18Handler.MC_1_20_6_Version => typeof(StructuredComponentsRegistry1206),
|
||||
Protocol18Handler.MC_1_21_Version => typeof(StructuredComponentsRegistry121),
|
||||
>= Protocol18Handler.MC_1_21_11_Version => typeof(StructuredComponentsRegistry12111),
|
||||
>= Protocol18Handler.MC_1_21_5_Version => typeof(StructuredComponentsRegistry1215),
|
||||
>= Protocol18Handler.MC_1_21_2_Version => typeof(StructuredComponentsRegistry1212),
|
||||
_ => throw new NotSupportedException($"Protocol version {protocolVersion} is not supported for structured component registries!")
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ namespace MinecraftClient.Protocol
|
|||
{
|
||||
4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573,
|
||||
575, 578, 735, 736, 751, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768,
|
||||
769, 770, 771, 772, 773
|
||||
769, 770, 771, 772, 773, 774
|
||||
};
|
||||
|
||||
if (Array.IndexOf(suppoertedVersionsProtocol18, protocolVersion) > -1)
|
||||
|
|
@ -368,6 +368,8 @@ namespace MinecraftClient.Protocol
|
|||
case "1.21.9":
|
||||
case "1.21.10":
|
||||
return 773;
|
||||
case "1.21.11":
|
||||
return 774;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -455,6 +457,7 @@ namespace MinecraftClient.Protocol
|
|||
771 => "1.21.6",
|
||||
772 => "1.21.7",
|
||||
773 => "1.21.9",
|
||||
774 => "1.21.11",
|
||||
_ => "0.0"
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue