Skip to content

FIx: crash when using Bone Meal#1171

Closed
ghost wants to merge 1 commit into
ver/26.1from
unknown repository
Closed

FIx: crash when using Bone Meal#1171
ghost wants to merge 1 commit into
ver/26.1from
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented May 19, 2026

FIx a crash when applying bone meal on ≤ 1.21.11 servers

Closes: #1164

In 26.1.x the method BoneMealItem.useOn() emits a checkcast to InteractionResult$Pass after reading PASS, but when targeting ≤ 1.21.11 servers, the @Redirect injects a SUCCESS there, which fails the cast and crashes the game

Fix: replace the @Redirect with an @Inject at RETURN which intercepts the final return value after the game logic is completed. The result is typed as InteractionResult with no internal casts, allowing to replace PASS to SUCCESS for <=1.21.11 servers as intended

Test:

Joining a server using 1.21.11 version and start using bone meal anywhere. Everything works fine.
Joining a server using 26.1-26.1.2 version: works fine as well.

@ghost ghost self-requested a review May 19, 2026 08:35
@florianreuth
Copy link
Copy Markdown
Member

The original method returns PASS in two conditions where only the first one changed, these changes would break the logic since they always redirect PASS->SUCCESS, even in the unchanged case.

@ghost
Copy link
Copy Markdown
Author

ghost commented May 19, 2026

The original method returns PASS in two conditions where only the first one changed, these changes would break the logic since they always redirect PASS->SUCCESS, even in the unchanged case.

Oh right... i forgot there is one when fail to apply. Will look into that.

Repository owner closed this by deleting the head repository May 19, 2026
@Kichura
Copy link
Copy Markdown
Member

Kichura commented May 19, 2026

Auto-Closed because creator of this PR deleted their account.

@florianreuth
Copy link
Copy Markdown
Member

what

@Kichura
Copy link
Copy Markdown
Member

Kichura commented May 19, 2026

what

If it says "ghost" as OP's name then it's because the person's account is gone, hence why this happens.

@florianreuth
Copy link
Copy Markdown
Member

Yeah I know, but why

@Kichura
Copy link
Copy Markdown
Member

Kichura commented May 19, 2026

Yeah I know, but why

Unfortunately, i cannot read other people's minds so this probably will remain a mystery.

@florianreuth
Copy link
Copy Markdown
Member

03ef7a2

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.

Crash when bonemealing on server

3 participants