Skip to content

fix: leave MMOCore class skill casts alone - #37

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/ignore-mmocore-class-casts
Sep 30, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/ignore-mmocore-class-casts

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

MMOCore subclasses (class rework, being tested on TFMCDev01) cast spells from the skill bar. Magic treated those casts like rune casts. So a class cast could be refused or whiffed when the caster held a mage weapon, it wore that weapon's durability, and it drifted the caster's resonance equilibrium.

  • SkillIdResolver.isClassCast(Skill): true for an MMOCore CastableSkill.
  • ResonanceCastListener and CastDriftListener return early for class casts.

Rune casts (MMOItems abilities) are unchanged.

Resonance skill modifiers are keyed by skill handler in MythicLib, so they can't tell a rune cast from a class cast. The subclass configs handle that side: a rune spell used by a class gets its own CLASS_<ID> MythicLib handler, and Magic's skills.yml binds only the rune handler.

Tests

  • New ClassCastSkipTest: the resolver, the gate (no cancel, no weapon lookup, no whiff) and drift (equilibrium unchanged) for class casts.
  • mvn verify passes, and coverage stays at 100% line/branch/instruction.
  • The build is running on TFMCDev01 as magic-DEV-classcast-20260930.jar (0.4.7 plus this change). magic-0.4.7.jar is backed up in ~/dev-jar-backup/.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Class casts no longer trigger resonance handling or cast-drift effects. Other casts continue through the existing handling.

Subclass spells are cast from the MMOCore skill bar, not from runes. Skip
them in the resonance gate (refusal, overload and rift whiffs, weapon wear)
and in cast drift, so class casts behave the same with or without Magic.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ca4f4606-e575-4ac2-8602-0590b010f867

📥 Commits

Reviewing files that changed from the base of the PR and between e54d57c and 9dfa161.

📒 Files selected for processing (4)
  • src/main/java/net/tfminecraft/magic/integration/SkillIdResolver.java
  • src/main/java/net/tfminecraft/magic/listener/CastDriftListener.java
  • src/main/java/net/tfminecraft/magic/listener/ResonanceCastListener.java
  • src/test/java/net/tfminecraft/magic/ClassCastSkipTest.java

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Adds a class-cast predicate and updates the cast-drift and resonance listeners to skip class casts. Tests cover predicate results and verify the listeners do not process class casts.

Changes

Class cast handling

Layer / File(s) Summary
Detect and skip class casts
src/main/java/net/tfminecraft/magic/integration/SkillIdResolver.java, src/main/java/net/tfminecraft/magic/listener/CastDriftListener.java, src/main/java/net/tfminecraft/magic/listener/ResonanceCastListener.java, src/test/java/net/tfminecraft/magic/ClassCastSkipTest.java
SkillIdResolver identifies CastableSkill instances. Both listeners return for class casts. Tests check cast identification and listener behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to 9dfa1

MMOItems rune casts on the repository’s normal path remain unaffected, while MMOCore class casts are skipped as intended. No current merge-blocking risk is evident.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9dfa1

The change consistently excludes class casts before rune restrictions or state changes occur. No player-controlled bypass is demonstrated. Remaining uncertainty concerns the skill types emitted by the deployed plugins and the configuration separating class and rune handlers.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The directly affected controls govern the event caster's held weapon and player-keyed resonance session. Class casts cease reaching those existing effects; the changed guards introduce no new target selection or cross-player state write.

Trust Boundaries and Controls

  • inferred — No repository-supported path shows a player converting a rune cast into CastableSkill to evade rune controls. Nevertheless, such an object would bypass both listeners, so the separation depends on the external producers preserving the intended runtime-type distinction.

Resilience and Maintainability Implications

  • inferred — For casts classified as class casts, repetition or interruption cannot leave a partially applied transition within these listeners because both return before side effects. Cancellation annotations and the regular-cast update path remain unchanged. Tests support the local behavior but do not establish external event ordering or failure propagation.

Hardening Proposals

  • proposed — Before wider deployment, validate real rune and class event runtime types and confirm distinct class/rune handler registrations. This would close the remaining producer-contract and modifier-isolation gaps rather than address a verified vulnerability.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: excluding MMOCore class skill casts from rune-cast handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks each cast with care
Class casts pass without a stare
The listeners skip and let them be
Tests confirm the paths stay free
Then off I hop beneath the trees

Comment @coderabbitai help to get the list of available commands.

@XxFran10xX
XxFran10xX merged commit 2bb5b08 into main Sep 30, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/ignore-mmocore-class-casts branch September 30, 2026 20:13
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