Add a build check guarding against @OnlyIn slipping in from 1.21 upmerges - #239
Closed
rubensworks wants to merge 1 commit into
Closed
Add a build check guarding against @OnlyIn slipping in from 1.21 upmerges#239rubensworks wants to merge 1 commit into
rubensworks wants to merge 1 commit into
Conversation
…rges @onlyin was removed in NeoForge 26, but it is still valid on the 1.21 branch, so upmerges can silently reintroduce it. NeoForge then logs a startup warning via OnlyInWarningsHandler. Related to #238 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MXLQ4EF4nPh69C3ig3hjHZ
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.
Related to #238
The reported bug is already fixed
@OnlyIncame fromClientRecipeInputsTooltip, added on the 1.21 branch in de52573 and carried into 26 by merge cf29679. It was already removed onmaster-26-ltsby merge commit 79c7a4f (2026-09-11), as part of the upmerge conflict resolution.Verified against the published jars, scanning for the
net/neoforged/api/distmarker/OnlyIndescriptor in the bytecode:26.1.2-1.6.0-739(the version in the issue)ClientRecipeInputsTooltip.class26.1.2-1.7.0(current release)26.2-1.4.7-768So the reporter is on a build that predates the fix. The warning itself comes from
net.neoforged.neoforge.common.OnlyInWarningsHandler, new in NeoForge 26, which logsThe mod {} uses the @OnlyIn annotation; the runtime member-stripping behaviour of this annotation is no longer present.I also checked every other Cyclops repo that has a
master-26-ltsbranch, plus the latest published 26.1.x and 26.2 jars of all 15 Cyclops mods on Modrinth. All clean. The only remaining@OnlyInoccurrences anywhere are inEvilCraft-Compatundermodcompat/bloodmagic/, whichbuild.gradleexcludes from compilation.What this PR changes
Since
@OnlyInstays valid on the 1.21 branch, a future upmerge can silently reintroduce it again. This adds acheckNoOnlyInGradle task, wired intocheck, that fails the build listing the offending files.Verified both directions locally:
./gradlew buildpasses as-is, and temporarily re-adding@OnlyIn(Dist.CLIENT)toClientRecipeInputsTooltipmakes it fail with:Game tests were not run for this change, since it touches no mod code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MXLQ4EF4nPh69C3ig3hjHZ
Generated by Claude Code