Skip to content

Adapt framework code for MC 1.21.11 - part 2/3#295

Draft
mj41 wants to merge 1 commit intoTnze:masterfrom
mj41:mj-121-v2b
Draft

Adapt framework code for MC 1.21.11 - part 2/3#295
mj41 wants to merge 1 commit intoTnze:masterfrom
mj41:mj-121-v2b

Conversation

@mj41
Copy link

@mj41 mj41 commented Feb 16, 2026

Credits

Co-authored with Claude Opus 4.6 (Anthropic) via GitHub Copilot.

Summary

Hand-written framework changes to support Minecraft 1.21.11 (protocol 774).
Updates bot, server, level, registry, chat/signing, inventory, and component
infrastructure.

This PR contains only human-authored code changes — no auto-generated files.
Depends on PR #294 (tools pipeline). The generated data files follow in PR #296.

Commit

Adapt framework code for MC 1.21.11 — 41 files changed, 1,317 insertions(+),
204 deletions(-)

Changes by Category

Protocol Version

  • Bot ProtocolVersion: 767 → 774
  • Server ProtocolVersion: 764 → 774
  • Version string: "1.21.11"

Protocol Fixes

  • Registry handling (registry/): Added ExtraRegistries map for unknown
    registry types sent by 1.21.11 servers. Registry() returns dynamic registry
    instead of nil. Tags handler no longer fatals on unknown registries. ReadFrom
    always calls Put() to maintain ID ordering. Tags gracefully skip
    out-of-range IDs.
  • BitStorage (level/palette.go): Removed VarInt data array length prefix —
    MC 1.21.5+ (protocol 770+) no longer sends it. Reader computes expected long
    count from bits-per-entry and container capacity.
  • Teleport packet (bot/basic/events.go): Rewritten for protocol 769+
    format — TeleportID first, added DX/DY/DZ velocity fields, Flags from byte
    to int32.
  • Player settings (bot/basic/settings.go): ViewDistance/ChatMode/MainHand
    widened from int8 to int, added ParticleStatus field.
  • Chunk heightmaps (level/chunk.go): Encode as typed long arrays instead
    of NBT compound for protocol 774+.
  • TrustEdges removed (level/chunk.go): Removed from both ReadFrom and
    WriteTo (dropped in MC 1.20.2).

Chat & Signing

  • HistoryUpdate checksum (chat/sign/sign.go): Added Checksum byte field.
    Zero value = IGNORE_CHECKSUM (backward compatible).
  • PlayerChat globalIndex (bot/msg/chat.go): Added globalIndex VarInt as
    first field (new in 1.21.11).
  • PackedSignature (chat/sign/sign.go): Fixed value→pointer receiver, added
    id - 1 decode for wire format, io.ReadFull for 256-byte signatures.

Inventory & Components

  • Slot format (bot/screen/screen.go): Rewrote ReadFrom/WriteTo for
    post-1.20.5 format. ReadFrom now consumes component data via
    component.NewComponent(). WriteTo sends Count→ItemID→0→0 (no custom
    components). Removed NBT field.
  • SetPlayerInventory handler (bot/screen/screen.go): New handler for
    ClientboundSetPlayerInventory packet (1.20.5+).
  • Component infrastructure (level/component/types.go): 541 lines of shared
    component types — EitherHolder, Holder, CompositeHolder, ItemSlot,
    FilterableText, SoundEvent, etc.
  • New component files: bannerpatterns.go, bees.go, blocksattacks.go,
    blockstate.go, eitherholder.go, kineticweapon.go, profile.go,
    writtenbookcontent.go
  • Updated components: attributemodifiers.go, enchantments.go,
    lodestonetracker.go, suspicioussteweffects.go, tool.go,
    writablebookcontent.go

Server-Side

  • RegistryData format (server/configuration.go): Rewrote from single NBT
    blob to per-registry packets (1.20.5+ format).

Breaking Changes

  • Slot struct: Removed NBT field, added ComponentsAdd/ComponentsRemove
  • Teleported callback: flags byteflags int32
  • ClientboundLoginGameProfile renamed to ClientboundLoginLoginFinished
  • Bot/Server ProtocolVersion changed

Related

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.

1 participant