Skip to content

Update MinecraftCom.cs#4

Closed
dogwatch wants to merge 1 commit intoMCCTeam:masterfrom
dogwatch:patch-1
Closed

Update MinecraftCom.cs#4
dogwatch wants to merge 1 commit intoMCCTeam:masterfrom
dogwatch:patch-1

Conversation

@dogwatch
Copy link
Contributor

No description provided.

@featherbear
Copy link

Still has a spelling mistake :) "lenght"

@dogwatch
Copy link
Contributor Author

Not my ;)

@ORelio
Copy link
Member

ORelio commented Jul 19, 2013

Didn't see that spelling mistake until now :o
Could you send next pull requests to the "Indev" branch? :)
https://github.com/ORelio/Minecraft-Console-Client/tree/Indev
(Is there a way for me to merge this request into the "Indev" branch instead of master?)

@featherbear
Copy link

http://bit.ly/14likb4
xD

@ORelio
Copy link
Member

ORelio commented Jul 19, 2013

Lol. It seems that's not possible unless closing this pull request and opening another one on the right branch.

@ORelio
Copy link
Member

ORelio commented Jul 20, 2013

Please pull this to the Indev branch.

@ORelio ORelio closed this Jul 20, 2013
milutinke added a commit that referenced this pull request Mar 29, 2023
Implement 1.8 Entity MetaData
BruceChenQAQ added a commit to BruceChenQAQ/Minecraft-Console-Client-1.19dev that referenced this pull request Mar 18, 2026
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 MCCTeam#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants