Skip to content

Let sealed artifacts from the Rune Crafting Station break open into rolled artifacts - #65

Merged
XxFran10xX merged 2 commits into
mainfrom
feat/sealed-artifact-craft
Oct 21, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
feat/sealed-artifact-craft

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Artifacts can now be crafted. The Rune Crafting Station (MMOItems, configured in ServerAssets) crafts Sealed Artifacts, which are LOOT items. Right-clicking one breaks the seal and gives an artifact rolled the same way as a Dowsing Artifact Mine drop.

  • New artifacts/sealed.yml. It lists the sealed items (TLibs path), each with a locked school or random, and the rarity weights. The bundled weights are 65/25/7/3, the same as the live Artifact Mine node. An entry can set its own rarities. Magic copies the file in when it is missing, so live servers get it on the next start without editing config.yml.
  • Same artifacts as the node. The plugin picks a rarity by weight, then uses the existing ArtifactRoller.roll(element, rarity) and ArtifactItemBuilder. Caps, secondary schools, wear and Recycler value therefore match node artifacts. A school-locked seal still rolls secondaries; the magic.(primary=…) path does not. Random seals pick from random_pool by type weight.
  • The item is only used up when the artifact was made. If the roll or build fails, the seal stays, the player gets a message and the console a warning. A full inventory drops the artifact at the player's feet.
  • Block clicks still work. Right-clicking chests, doors and other usable blocks uses the block; sneaking opens the seal instead. A click that fires several interact events (block then air, main then off hand) breaks only one seal, even when other players click in the same tick.
  • Logging. Each opened seal is logged to the console (Sealed artifact opened: player=… seal=… element=… rarity=…), so craft supply can be counted from the server logs. aura.log would not work for this because it is wiped on every start.
  • Rarity weights are scaled by the largest one before summing, as ArtifactRoller does, so very large weights stay fair.
  • Config problems never fail the artifact configs. Unknown rarities or elements, negative or non-finite weights, a missing bracket, or an unreadable file each give a warning and skip that entry or the feature, as with shrines.yml and sacrifice.yml.
  • No odds are shown to players.

Rollout

The planned Rune Crafting Station recipes (ServerAssets PR) are 18 Enchanted Dust for a random Sealed Artifact and 28 for each of the Oseni, Seithr, Cerrith and Mitlan ones. At 18 dust, the Artifact Mine node stays slightly better than Dust Mine plus crafting. Crafting then recycling loses about half the dust, so there is no loop.

Tests

  • SealedArtifactTest:
    • the bundled sealed.yml loads 5 seals against the bundled generator;
    • missing or broken files and every invalid entry or weight give a warning;
    • registry matching, including the material fast path;
    • the rarity pick follows the weights over 100k seeded picks, and stays even with weights near Double.MAX_VALUE;
    • an open uses exactly one item, keeps the stack, sends the message, sound and log line;
    • a full inventory drops the artifact;
    • a failed roll or build keeps the seal.
  • SealedArtifactListenerTest: right-click air and block, usable blocks, sneaking, denied item use, other actions, the off hand, and one seal per click, including another player's click in between.
  • Locally on Windows: mvn verify shows the same failing set as main. Those are only the Windows file-lock gear-ownership tests, and none are new. The new classes and the changed ArtifactConfigLoader and Magic have 100% line and branch coverage. Linux CI runs the full gate.
  • Dev bot test with a real character: see the comment below.

🤖 Generated with Claude Code

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d18490ac-28eb-48d5-af59-fd7b3cf4c232
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (tests excluded in mixed PRs). label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Dev test (TFMCDev01, real character bot TestChar2 as a Mage)

There were two runs: the first used 10827ac, the second used 5cf4403, which has the review fixes. Both ran with ServerAssets#71's loot.yml and rune-station.yml. On start, Dev logged Artifact generator: … sacrifice=3, sealed=5 and no sealed warnings.

Passed on 5cf4403:

  • Breaking seals:

    • A Sealed Cerrith Artifact broke on a right-click in the air and gave a Cerrith artifact.
    • A random seal gave a planar-school artifact.
    • Exactly one seal was used, the artifact was in the inventory, and the player got the "seal breaks" message.
  • One click, one seal: a block click plus the trailing use packet broke exactly one seal.

  • Chests: clicking a chest opened the chest and kept the seal; sneak-clicking a chest broke the seal.

  • Rune Crafting Station:

    • The station lists all five Sealed recipes.
    • Random costs 18 Enchanted Dust and elemental costs 28.
    • Crafting used the 18 dust, and the Sealed Artifact was claimed from the queue after 10 s.
  • Distribution (each line is real seals opened on the server):

    Run Common Uncommon Rare Legendary Schools
    1 (200 seals) 61.5% 26.0% 9.0% 3.5% planar only
    2 (100 seals) 59.0% 28.0% 11.0% 2.0% planar only: mitlan 19, oseni 22, seithr 27, cerrith 32
  • latest.log has no sealed-artifact warnings or errors.

Not a plugin issue: off-hand seals on this server. A seal placed in the off hand never stays there. The server's equipment is {} straight after item replace … weapon.offhand, and the item is handed back to the main inventory when there is room, very likely by MMOInventory's custom off_hand slot. So a seal cannot be opened from the off hand in game. The listener still handles the off hand, and the unit tests cover it.

The full-inventory drop path can't happen with these items either. Seals are unstackable, so breaking one always frees the slot the artifact goes into. The drop is kept as a safety net and is covered by unit tests.

Review: CodeRabbit is rate-limited, so GPT-6.1-Sol reviewed instead.

  • Round 1 found two issues: interleaved same-tick clicks from two players could open extra seals, and overflow with huge weights. Both are fixed in 5cf4403, with regression tests.
  • Round 2: VERDICT: APPROVE.

XxFran10xX and others added 2 commits October 21, 2026 16:38
…olled artifacts

Right-clicking a sealed item listed in the new artifacts/sealed.yml rolls an
artifact the same way a Dowsing Artifact Mine drop is made: rarity by the
file's weights (65/25/7/3, as the live node), then the usual roller and
builder, so caps, secondary schools, wear and Recycler value match. A seal can
lock the school or roll it from random_pool. The item is only used up when the
artifact was made; a full inventory drops it at the player's feet. Each opened
seal is logged to the console for counting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s fair

The once-per-click guard remembered only the last player, so player A's
trailing event after player B's click in the same tick opened a second
seal. It now tracks every player who opened a seal this tick. Rarity
weights are divided by the largest before summing, as ArtifactRoller does,
so finite weights near Double.MAX_VALUE no longer overflow to the last
rarity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX force-pushed the feat/sealed-artifact-craft branch from 5cf4403 to 30ffb2b Compare October 21, 2026 14:38
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Rebased onto 006108b (#66) and retested on Dev as magic-0.11.0-sealed3.jar. Startup logged sealed=5, and all checks passed again: air click, block click, chest, sneak, the five station recipes at 18/28 dust, craft and claim, 60 random seals with planar schools only, and no warnings. The only failure was the same environment-only off-hand case described above. Linux CI is green on 30ffb2b.

@XxFran10xX
XxFran10xX merged commit 5392d65 into main Oct 21, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the feat/sealed-artifact-craft branch October 21, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant