Skip to content

Conversation

slbls
Copy link
Contributor

@slbls slbls commented Sep 27, 2025

This PR fixes #29 by addressing the DEL character (ASCII 127) insertion issue that occurs when running Minecraft 1.1 with deAWT enabled on macOS.

When deAWT removes AWT Frame and Canvas usage to fix graphical issues on Apple silicon, it also removes AWT's platform-specific key mapping functionality. Combined with a character validation logic change from Minecraft 1.0 to 1.1 (which accepts any character with ASCII value > 32 to support international languages), this causes the DEL character to be inserted as a visible character in text fields after performing deletion operations.

The fix modifies the bytecode validation to reject ASCII values ≤ 127 instead of ≤ 32, excluding DEL while preserving extended ASCII support for international characters.

Java isn't a language I typically work with, so please feel free to leave stylistic and idiomatic feedback as well.

@slbls
Copy link
Contributor Author

slbls commented Sep 27, 2025

@Lassebq, here's a second attempt with stricter constraints. Interested to know if there's an established way to get the currently running version of the game to further clamp down when this patch is applied.

@slbls slbls force-pushed the push-zluzvyuwokkz branch 2 times, most recently from 543f5b6 to 6e8c2f4 Compare September 27, 2025 15:07
@Lassebq Lassebq merged commit 873cd9d into MCPHackers:main Sep 28, 2025
@slbls slbls deleted the push-zluzvyuwokkz branch September 28, 2025 13:20
@Lassebq
Copy link
Member

Lassebq commented Sep 28, 2025

I will need to introduce some runtime remapping to easier analyze these patches in vanilla and make modified classes easier to read. I did have a few nits on this PR but I accepted it anyway, it does what it needs to do without possible conflicts or false positives

@slbls
Copy link
Contributor Author

slbls commented Sep 28, 2025

Thanks for helping me see this through and bearing with me while I got my bearings. Let me know if there's any follow-ups that I can help with. I'm happy to address any nits or play a part in helping with making modified classes easier to read.

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.

Delete key inserts ASCII code 127 after deleting character on macOS
2 participants