Skip to content

Gate rune keybind casts by weapon attunement - #25

Merged
Drefvelin merged 1 commit into
mainfrom
fix/rune-keybind-casts
Sep 24, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/rune-keybind-casts

Conversation

@Drefvelin

@Drefvelin Drefvelin commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The cast listener only treated MythicLib CAST and API as spells, so a rune set to right-click, left-click, or shift-click fired even when the weapon was not attuned to that element.
  • runes.keybinds in config.yml is now loaded on startup and reload. Those triggers, plus CAST and API, go through the same refusal, rift, and overload checks. Equilibrium drift follows the same set.

Test plan

  • Confirm startup logs Cast triggers: CAST, API, RIGHT_CLICK, LEFT_CLICK, SHIFT_RIGHT_CLICK, SHIFT_LEFT_CLICK on a server whose config already lists those keybinds.
  • Socket an Oseni rune on a Cerrith-only staff and right-click: the cast is refused and costs nothing.
  • Cast a Cerrith rune from that same staff when resonance is high enough: the spell fires.
  • /magic reload after editing runes.keybinds picks up the new list.

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Added configurable rune keybind triggers for cast checks, including right-click, left-click, and their shift-click variants.
  • Bug Fixes
    • Cast checks now recognize configured triggers alongside CAST and API skills.

Right-click and shift-click rune abilities were ignored because the cast listener only watched CAST and API. Those keybinds are already listed in config, so the listener now treats every configured trigger as a cast.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

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

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 26044399-f406-4f9f-ac5e-0380b57e6bd6

📥 Commits

Reviewing files that changed from the base of the PR and between 6d1a72d and cd882a4.

📒 Files selected for processing (4)
  • src/main/java/net/tfminecraft/magic/Cache.java
  • src/main/java/net/tfminecraft/magic/integration/SkillIdResolver.java
  • src/main/java/net/tfminecraft/magic/loader/ConfigLoader.java
  • src/main/resources/config.yml
 _________________________________________________________
< Your config has more knobs than a 2004 Honda dashboard. >
 ---------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@Drefvelin
Drefvelin merged commit 1dba257 into main Sep 24, 2026
1 of 2 checks passed
@Drefvelin
Drefvelin deleted the fix/rune-keybind-casts branch September 24, 2026 16:47
Drefvelin pushed a commit that referenced this pull request Sep 24, 2026
The same "magic update" commit also dropped the spell side of the first
commit. Bring back:

- Spell tier gates. skills.yml tier is the floor for both the weapon's band
  and the caster's resonance, with separate weapon and spell refusal lines.
- /magic rune keybind <trigger> to rebind a held rune's abilities, with the
  magic.rune.keybind permission and runes.types config.
- Element permissions. Locked schools stay hidden in the resonance menu, do
  not grow, and are skipped by admin resonance commands.
- The cast mode switch chat line and "Click to Select" hint.

The runes section merges with the cast triggers from #25. Element names keep
the gradient colouring from #26. The per-cast durability debug log is not
restored.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drefvelin added a commit that referenced this pull request Sep 24, 2026
)

* fix: restore gear crafting lost in the magic update

The 2026-09-20 "magic update" commit was pushed from an older copy and dropped
the gear work from the first commit: sneak-left-click craft abort with refunds,
core part-limit slots, part stats, tiers, model schemes, the socket rarity
prefix toggle, and the post-charge chat summary. Live gear configs still use
all of these keys.

Bring that code back on top of current main, keeping the TLibs package move,
hidden unchargeable elements, and the spell modifier resync after charging.

The gear station is also protected from ItemsAdder breaks while it holds a
weapon, runs orbs, or has just been aborted, since orb hits and aborts are
swings that ItemsAdder treats as a furniture break.

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

* fix: avoid deprecated stat history and model data calls in gear

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

* fix: restore spell tiers, rune keybinds and resonance locks

The same "magic update" commit also dropped the spell side of the first
commit. Bring back:

- Spell tier gates. skills.yml tier is the floor for both the weapon's band
  and the caster's resonance, with separate weapon and spell refusal lines.
- /magic rune keybind <trigger> to rebind a held rune's abilities, with the
  magic.rune.keybind permission and runes.types config.
- Element permissions. Locked schools stay hidden in the resonance menu, do
  not grow, and are skipped by admin resonance commands.
- The cast mode switch chat line and "Click to Select" hint.

The runes section merges with the cast triggers from #25. Element names keep
the gradient colouring from #26. The per-cast durability debug log is not
restored.

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

* fix: tie gear aborts to the preparer and what they paid

Anyone could abort another player's prepared craft and take its material
refund, and cost-bypass players got refunds for materials never taken.
Stations now record who prepared the craft and the exact materials charged.
Only that player (or an admin) can abort it, and the refund is what was
paid. Stations saved before this keep the old behaviour.

Also break model-scheme ties between the tied leaders only, and fix the
"Ascendant Rune" suffix, the petty_tome3 id and two lore typos in the
bundled gear defaults.

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

---------

Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants