Skip to content

Add support for Minecraft 1.21.11 with API compatibility fixes#12

Open
ejeebus wants to merge 15 commits into
IceTank:1.21.4from
ejeebus:1.21.4
Open

Add support for Minecraft 1.21.11 with API compatibility fixes#12
ejeebus wants to merge 15 commits into
IceTank:1.21.4from
ejeebus:1.21.4

Conversation

@ejeebus

@ejeebus ejeebus commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Adds a v1_21_11 module targeting Minecraft 1.21.11 with sakura-ryoko's Litematica fork (1.21.11-0.26.3), ported from the existing v1_21_4 module.

API changes from 1.21.4 → 1.21.11

  • lastPitch/lastYaw renamed to prevPitch/prevYaw and moved from ClientPlayerEntity up to Entity — removed EntityAccessor and updated all access sites
  • lastSneaking field removed from ClientPlayerEntity — removed accessor and updated PresShift/ReleaseShiftAction
  • invertYMouse made private in GameOptions — replaced direct field access with a new GameOptionsAccessor mixin using @Accessor
  • invertYMouse() public getter added in 1.21.11 — MixinMouse updated to call it directly without reflection
  • LitematicaSchematicAccessor @Invoker updated: constructor signature changed from (File, FileType) to (Path, FileType) in sakura-ryoko's fork; SchematicConverter updated to pass .toPath() accordingly
  • PlayerInventoryAccessor added to expose offHandInventory — required for offhand slot handling that changed in 1.21.11

Notes

  • The v1_21_4 module is unchanged
  • Tested on a live 1.21.11 Fabric client connecting to a 1.21.4 server via ViaFabricPlus

ejeebus and others added 15 commits June 6, 2026 05:25
- Rename ClientCommandC2SPacket.Mode PRESS/RELEASE_SHIFT_KEY → START/STOP_SNEAKING
- Replace PlayerInventory.main direct field access with getStack/setStack/36
- Replace inventory.selectedSlot writes with PlayerInventoryAccessor mixin
- Replace inventory.selectedSlot reads with getSelectedSlot()
- Fix InputUtil.isKeyPressed to take Window instead of long handle
- Fix SchematicConverter.writeToFile to use Path (out.toPath())
- Fix ButtonListenerMixin to call getFile().toFile() for File param
- Fix MixinMouse to use options.invertYMouse directly (getter removed)
- Add PlayerInventoryAccessor mixin for selectedSlot write access

https://claude.ai/code/session_012vAEEvZwTHLuks9BMc13yB
Apply all MC 1.21.4→1.21.11 API fixes to the v1_21_11 module:
- PRESS/RELEASE_SHIFT_KEY → START/STOP_SNEAKING
- PlayerInventory.main private field → getStack/setStack/36
- selectedSlot direct access → getSelectedSlot() / PlayerInventoryAccessor
- InputUtil.isKeyPressed: long handle → Window
- SchematicConverter.writeToFile: File → Path
- ButtonListenerMixin.getFile() → getFile().toFile()
- MixinMouse: getInvertYMouse() → invertYMouse
- Entity.getWorld() → mc.world (ClientWorld)
- Entity.getPos() → new Vec3d(getX(), getY(), getZ())
Add 1.21.11 support with API compatibility fixes
- PresShift/ReleaseShiftAction: replace ClientCommandC2SPacket sneaking
  modes (removed in 1.21.5+) with PlayerInputC2SPacket
- ButtonListenerMixin: entry.getDirectory() returns Path, add .toFile()
- MixinMouse: invertYMouse is now a method invertYMouse() in 1.21.11
In MC 1.21.11 the field was renamed to invertMouseY and is now exposed
via getInvertMouseY(). Remove GameOptionsAccessor mixin (which looked for
the old invertYMouse field name and crashed at runtime) and call the public
method directly from MixinMouse.
The @ModifyVariable on PlayerMoveC2SPacket.<init> conflicts with
ViaFabricPlus's movement packet translation when connecting to 1.21.4
servers (like 2b2t), causing unknown packet id errors. The yaw/pitch
override is handled separately by grimRotate so this mixin is not
needed for core printer functionality.
The constructor signature changed from (File, FileType) to (Path, FileType)
in the sakura-ryoko litematica fork for 1.21.11. The old @invoker was causing
a fatal mixin transformation failure on world join, which manifested as
"Network Protocol Error" when connecting to 2b2t.
Both were removed as guesswork to fix the Network Protocol Error on 2b2t.
The actual root cause was LitematicaSchematicAccessor failing due to a
constructor signature change (File→Path), now fixed separately.

Neither mixin touched the packet pipeline in a way that would cause that
error — restoring them to recover:
- PlayerMoveC2SPacketMixin: yaw/pitch override for printer look actions
- MixinClientConnection: airplace offhand slot suppression + 2b2t ghost item fix
The ghost item fix was cancelling all ScreenHandlerSlotUpdateS2CPacket
for hotbar block items, including legitimate corrections when the server
reduces item count after placement. This caused the client to believe it
still had blocks it had already placed, producing ghost blocks.

Now only cancel if the incoming packet is a true duplicate (same item
type, components, and count). Actual count corrections from the server
are allowed through so the client inventory stays in sync.
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