fix: MouseMixin targets onButton on NeoForge 1.21.5+ (fixes 1.21.11 startup crash) - #25
Merged
Merged
Conversation
The mouse button handler was renamed onPress -> onButton(MouseButtonInfo) in 1.21.5. MouseMixin only used onButton for >=26, so on NeoForge 1.21.11 the injector could not find onPress and crashed at startup. Widen the neoforge branch guard from >=26 to >=1.21.5.
Bump mod_version to 1.6.1 and add changelog for the NeoForge 1.21.11 MouseMixin (onButton) startup-crash fix.
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.
Проблема
На NeoForge 1.21.11 мод падал при запуске:
Причина
В MC 1.21.5 обработчик кнопок мыши переименован
onPress(long,int,int,int)→onButton(long, MouseButtonInfo, int). ВMouseMixinвариантonButtonбыл под//? if >=26, а версии 1.21.5..<26 (в т.ч. 1.21.11) на neoforge продолжали таргетить несуществующийonPress.Фикс
Граница neoforge-ветки расширена
>=26→>=1.21.5(импортMouseButtonInfo, сигнатура инъекции, тело). Затрагивает только 1.21.11-neoforge; 26.x уже использовалиonButton, 1.21.1 (<1.21.5) остаётся наonPress.Проверка
runClientдля 1.21.11-neoforge: миксин применяется, MCEF инициализируется, краша нет. Остальные версии (1.21.1/26.1.2/26.2-neoforge, все fabric) не затронуты.