Minecraft-Console-Client/MinecraftClient/Protocol/Handlers
BruceChen a92bf5b071 feat: complete 1.21.2 protocol handling for terrain, inventory, and entity support
The previous commits added palette files, packet IDs, and structured components
for MC 1.21.2 (protocol 768), but terrain/inventory/entity features were still
disabled at runtime because the version guards in the constructor checked
> MC_1_21_Version (767) instead of > MC_1_21_2_Version (768).

This commit completes the 1.21.2 adaptation with the following changes:

- Update feature-disable guards from > MC_1_21_Version to > MC_1_21_2_Version
  so terrain, inventory, and entity handling are enabled for protocol 768
- Update healthField metadata index guard to > MC_1_21_2_Version
- Handle container ID encoding change: byte -> VarInt for 1.21.2+ in both
  clientbound reads (CloseWindow, WindowItems, WindowProperty, SetSlot) and
  serverbound sends (ClickWindow, CloseWindow)
- Handle EntityTeleport format change: 1.21.2 uses PositionMoveRotation
  (pos + delta + float angles) + relative flags bitmask (int) + onGround
- Handle TimeUpdate format change: 1.21.2 appends a tickDayTime boolean
- Add handlers for new 1.21.2 packets: EntityPositionSync, PlayerRotation,
  SetCursorItem, SetPlayerInventory, MoveMinecartAlongTrack, and
  RecipeBookAdd/Remove/Settings (ignored, MCC doesn't track recipes)

Tested: successful connection to 1.21.2 vanilla server with inventory,
entity tracking, and chat all working correctly.

Made-with: Cursor
2026-03-20 03:45:32 +08:00
..
Forge refactor(ForgeInfo.cs): Remove unused code and edit comments 2024-02-20 22:02:22 +08:00
Packet/s2c Preliminary 1.21 Support 2024-12-06 16:45:48 +01:00
PacketPalettes feat: add packet palette, data components, and protocol fixes for MC 1.21.2 2026-03-20 03:25:20 +08:00
StructuredComponents feat: add packet palette, data components, and protocol fixes for MC 1.21.2 2026-03-20 03:25:20 +08:00
ConfigurationPacketTypesIn.cs Preliminary 1.21 Support 2024-12-06 16:45:48 +01:00
ConfigurationPacketTypesOut.cs 1.20.6 - Not working yet 2024-06-16 01:19:09 +02:00
DataTypes.cs fix: add EntityMetadataPalette1206 for correct 1.20.6+ entity metadata parsing 2026-03-20 01:43:48 +08:00
PacketType18Handler.cs feat: add packet palette, data components, and protocol fixes for MC 1.21.2 2026-03-20 03:25:20 +08:00
PacketTypesIn.cs feat: add packet palette, data components, and protocol fixes for MC 1.21.2 2026-03-20 03:25:20 +08:00
PacketTypesOut.cs feat: add packet palette, data components, and protocol fixes for MC 1.21.2 2026-03-20 03:25:20 +08:00
Protocol16.cs 1.20.6 - Not working yet 2024-06-16 01:19:09 +02:00
Protocol18.cs feat: complete 1.21.2 protocol handling for terrain, inventory, and entity support 2026-03-20 03:45:32 +08:00
Protocol18Forge.cs fix(Protocol18Forge.cs): Version bigger or equal 1.18 is FML3 2024-02-20 22:23:46 +08:00
Protocol18Terrain.cs 1.19.3 PlayerRemove & Explosion packet 2023-01-14 15:55:40 +08:00
SocketWrapper.cs First Version of Structured Components 2024-09-01 20:42:39 +02:00
ZlibUtils.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00