fix: replace deprecated Minecraft and Gradle APIs before they break #13
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
6b6t/AnarchyClient!13
Loading…
Reference in a new issue
No description provided.
Delete branch "t3/client-health-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A health check of the 26.3 build found code that still compiles but could break on a future Minecraft or Gradle update. Several modules call Minecraft APIs that Mojang has deprecated, and the build script uses a pattern that Gradle 10 will reject.
This PR swaps each deprecated call for its supported equivalent:
BuiltInRegistries.ITEM.getKey, which other modules already use.MobEffectInstance.is(Holder). It does the same equality check.ClientIntentionPackethas only one constructor, and it is deprecated. Vanilla'sConnectionuses it too, so the warning is suppressed on that single local variable.isSolid()behind a scoped suppression. It has no public replacement because it also reads private per-block properties, and a full-block check would stop slabs, stairs, and fences from counting as hole walls.processResourcesreads the mod version during configuration instead of while the task runs.Verification
./gradlew buildpasses, and all 415 tests pass.-Xlint:deprecationshows no unsuppressed Java deprecation warnings.Task.projectwarning is gone, and the builtfabric.mod.jsonstill has version0.2.2.ItemStacktests for SmartEat and AutoPot, but 26.3 only binds item components after a world's registries load. That setup is out of scope for this PR.AI-assisted: written by Claude Code. There is no linked issue; this came from a client health check.
Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Summary by CodeRabbit
Walkthrough
The changes update resource version expansion, block and item checks in gameplay modules, potion effect matching, and deprecation-warning handling for handshake packet construction.
Changes: Resource version processing
build.gradle.ktsprocessResourcesconverts the project version to a string and uses it for the task input andfabric.mod.jsonexpansion.Module checks
src/main/java/net/blockhost/anarchyclient/module/impl/AntiBedModule.javaisInHolechecks whether surrounding blocks and the block beneath the player have full-block collision shapes.src/main/java/net/blockhost/anarchyclient/module/impl/AutoPotModule.javamatchesPotioncompares each effect instance with the target holder throughMobEffectInstance.is.src/main/java/net/blockhost/anarchyclient/module/impl/SmartEatModule.javaBuiltInRegistries.ITEM.getKey.Handshake packet construction
src/main/java/net/blockhost/anarchyclient/module/impl/BungeeCordSpoofModule.java,src/main/java/net/blockhost/anarchyclient/module/impl/ServerSpoofModule.java,src/test/java/net/blockhost/anarchyclient/module/impl/MeteorExpansionModulesTest.javaEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Merge Risk:
Low · up to
ec54cAntiBed with onlyInHole enabled may stop placing string in holes walled by stairs, slabs, or fences. The other deprecation replacements appear behavior-preserving. Confirm the intended hole definition before merging.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the primary change: replacing deprecated Minecraft and Gradle APIs. The changeset matches this. It updates deprecated Minecraft calls in SmartEat, AutoPot, AntiBed, ServerSpoof, and BungeeCordSpoof, and changes processResources to capture the mod version during configuration. The title is specific and accurate, so the check passes.
Finishing Touches
Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
Actionable comments posted: 1
c28a3e82-b86a-4db8-8f21-bb3efc874e73Reviewing files that changed from the base of the PR and between
a3bc5fb557andec54c9a88d.build.gradle.ktssrc/main/java/net/blockhost/anarchyclient/module/impl/AntiBedModule.javasrc/main/java/net/blockhost/anarchyclient/module/impl/AutoPotModule.javasrc/main/java/net/blockhost/anarchyclient/module/impl/BungeeCordSpoofModule.javasrc/main/java/net/blockhost/anarchyclient/module/impl/ServerSpoofModule.javasrc/main/java/net/blockhost/anarchyclient/module/impl/SmartEatModule.javasrc/test/java/net/blockhost/anarchyclient/module/impl/MeteorExpansionModulesTest.javaIncluded review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
@ -94,10 +94,17 @@ public final class AntiBedModule extends Module {return false;The soul-sand example does not change. Partial solid neighbors do.
isInHolenow usesisCollisionShapeFullBlockin place ofisSolid(). WithonlyInHoleenabled, a hole that is walled by stairs, slabs, or fences can fail the check. The base code accepted these neighbors. String placement then stops in those holes, which the PR does not state as intended.Confirm whether this stricter hole definition is intended. If it is not, restore the previous classification for these neighbors in
isInHole. Keep the full-block check only where a full cube is required.✅ Addressed in commit
eea7934@ -94,10 +94,17 @@ public final class AntiBedModule extends Module {return false;Agreed, the stricter hole rule was not intended.
eea7934dafbrings backisSolid(), so slabs, stairs, and fences count as hole walls again.There is no public non-deprecated replacement.
calculateSolid()in 26.3 also reads the privateforceSolidOnandforceSolidOffblock properties, so a collision-shape heuristic cannot match it. The call now lives in one helper with a scoped@SuppressWarnings("deprecation")and a comment explaining why.