Skip to content

Add a build check guarding against @OnlyIn slipping in from 1.21 upmerges - #239

Closed
rubensworks wants to merge 1 commit into
master-26-ltsfrom
claude/funny-ramanujan-endjz2
Closed

Add a build check guarding against @OnlyIn slipping in from 1.21 upmerges#239
rubensworks wants to merge 1 commit into
master-26-ltsfrom
claude/funny-ramanujan-endjz2

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Related to #238

The reported bug is already fixed

@OnlyIn came from ClientRecipeInputsTooltip, added on the 1.21 branch in de52573 and carried into 26 by merge cf29679. It was already removed on master-26-lts by 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/OnlyIn descriptor in the bytecode:

Jar Result
26.1.2-1.6.0-739 (the version in the issue) hit: ClientRecipeInputsTooltip.class
26.1.2-1.7.0 (current release) clean
26.2-1.4.7-768 clean

So 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 logs The 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-lts branch, plus the latest published 26.1.x and 26.2 jars of all 15 Cyclops mods on Modrinth. All clean. The only remaining @OnlyIn occurrences anywhere are in EvilCraft-Compat under modcompat/bloodmagic/, which build.gradle excludes from compilation.

What this PR changes

Since @OnlyIn stays valid on the 1.21 branch, a future upmerge can silently reintroduce it again. This adds a checkNoOnlyIn Gradle task, wired into check, that fails the build listing the offending files.

Verified both directions locally: ./gradlew build passes as-is, and temporarily re-adding @OnlyIn(Dist.CLIENT) to ClientRecipeInputsTooltip makes it fail with:

* What went wrong:
Execution failed for task ':checkNoOnlyIn'.
> @OnlyIn does not exist anymore in this NeoForge version, remove it from:
    /home/user/IntegratedCrafting/src/main/java/org/cyclops/integratedcrafting/client/gui/tooltip/ClientRecipeInputsTooltip.java

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

…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
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.

1 participant