mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
In 1.20.6+, EntityProperties packets reference attributes by VarInt registry IDs instead of string names. Previously, a hardcoded dictionary of 22 attribute entries (matching the vanilla 1.20.6 registry) was used to map these IDs back to names. This works for vanilla servers but would fail silently for modded servers that add custom attributes — any unknown ID would be reported as "unknown". This commit replaces the hardcoded attribute dictionary with dynamic registry parsing, following the same pattern already used for dimension_type and chat_type registries: - World.cs: Add static `attributeIdMap` field, `SetAttributeIdMap()` and `GetAttributeNameById()` methods for storing/querying attribute names by their VarInt registry IDs. - Protocol18.cs (RegistryData handler): When the server sends a `minecraft:attribute` registry during the Configuration phase, parse all entries and store the ID→name mapping. The `minecraft:` prefix is stripped from entry names to match the format used in EntityProperties packets (e.g. "minecraft:generic.armor" → "generic.armor"). - Protocol18.cs (EntityProperties handler): Remove the hardcoded 22-entry `attributeDictionary` and use `World.GetAttributeNameById()` instead. Unknown IDs still fall back to "unknown" for safety. Also closes issue #4 (Disconnect packet extra boolean) — verified that both Play and Configuration phase Disconnect handlers already use `ReadNextChat()` (NBT format since 1.20.4+), matching the 1.20.6 protocol spec. No code changes needed; updated tracking document to mark as closed. Made-with: Cursor |
||
|---|---|---|
| .. | ||
| BlockPalettes | ||
| EntityMetadataPalettes | ||
| EntityPalettes | ||
| Block.cs | ||
| BlockExtension.cs | ||
| Chunk.cs | ||
| ChunkColumn.cs | ||
| CombatEventType.cs | ||
| CommandBlockFlags.cs | ||
| CommandBlockMode.cs | ||
| Dimension.cs | ||
| Direction.cs | ||
| DirectionExtensions.cs | ||
| Entity.cs | ||
| EntityMetadataPalette.cs | ||
| EntityMetaDataType.cs | ||
| EntityPose.cs | ||
| EntityType.cs | ||
| EntityTypeExtensions.cs | ||
| InteractType.cs | ||
| Location.cs | ||
| MapIcon.cs | ||
| MapIconType.cs | ||
| Material.cs | ||
| Material2Tool.cs | ||
| MaterialExtensions.cs | ||
| MessageFilterType.cs | ||
| Movement.cs | ||
| RaycastHelper.cs | ||
| VillagerInfo.cs | ||
| World.cs | ||