Add support for Minecraft 1.21.11 with API compatibility fixes#12
Open
ejeebus wants to merge 15 commits into
Open
Add support for Minecraft 1.21.11 with API compatibility fixes#12ejeebus wants to merge 15 commits into
ejeebus wants to merge 15 commits into
Conversation
- 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.
…with ViaFabricPlus
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
v1_21_11module targeting Minecraft 1.21.11 with sakura-ryoko's Litematica fork (1.21.11-0.26.3), ported from the existingv1_21_4module.API changes from 1.21.4 → 1.21.11
lastPitch/lastYawrenamed toprevPitch/prevYawand moved fromClientPlayerEntityup toEntity— removedEntityAccessorand updated all access siteslastSneakingfield removed fromClientPlayerEntity— removed accessor and updatedPresShift/ReleaseShiftActioninvertYMousemade private inGameOptions— replaced direct field access with a newGameOptionsAccessormixin using@AccessorinvertYMouse()public getter added in 1.21.11 —MixinMouseupdated to call it directly without reflectionLitematicaSchematicAccessor@Invokerupdated: constructor signature changed from(File, FileType)to(Path, FileType)in sakura-ryoko's fork;SchematicConverterupdated to pass.toPath()accordinglyPlayerInventoryAccessoradded to exposeoffHandInventory— required for offhand slot handling that changed in 1.21.11Notes
v1_21_4module is unchanged