fix: stop goats crashing the ram behavior mixin - #603
Open
KostiaFed wants to merge 1 commit into
Open
Conversation
PrepareRamNearestTargetMixin selected its target method by the old Yarn intermediary name method_36270. This build runs on unobfuscated names and loads no refMap, so the selector matched nothing and the mixin failed to apply, making every goat fail to load or spawn. Point the injector at lambda$start$2, the lambda in start() that calls chooseRamPosition, and drop the line that reassigned the local mob after ci.cancel(): it threw a NullPointerException on the cancelled path and had no effect on the actual target. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
Every goat fails to load or spawn on 26.1.2.
PrepareRamNearestTargetMixinselects its target method by the old Yarn intermediary namemethod_36270, but this build runs on unobfuscated names and loads no refMap, so the selector matches nothing and the mixin fails to apply — taking the whole class down with it:Fix
The real target is the lambda in
start()that callschooseRamPosition, confirmed againstminecraft-merged-deobf-26.1.2.jar:Its descriptor already matches the handler, so the change is just the selector:
method_36270→lambda$start$2.Also removed the line after
ci.cancel():ci.cancel()does not return, so this threw aNullPointerExceptionon exactly the branch whereevent.getTarget() == null— and it was dead code anyway, since assigning a local in an@Injecthandler cannot change the target in the injected method.Scope
Cancelling
EntityTargetEventnow works. Retargeting viaevent.setTarget(...)still does not apply — that needs a@Redirect/@ModifyArgon thechooseRamPositioncall plus an@Invoker(the method is private), which is left for a follow-up.AssignProfessionFromJobSiteMixinhas the same stale-selector problem (method_46891), but its body is commented out so it does not fail. Its current target islambda$create$6(Villager, ServerLevel, Holder$Reference), for wheneverVillagerCareerChangeEventgets enabled.Testing
gradlew compileJavapasses.