Skip to content

fix: keep artifacts as items and follow catalog item changes - #26

Merged
Nowkoo merged 1 commit into
mainfrom
fix/artifact-placement-and-catalog-items
Oct 10, 2026
Merged

Nowkoo merged 1 commit into
mainfrom
fix/artifact-placement-and-catalog-items

Conversation

@Nowkoo

@Nowkoo Nowkoo commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Recovered artifacts can no longer be placed as blocks. Placing one would lose its archive data, so the placement is cancelled and the player sees Artifacts can only be placed on displays. Displays (item frames, shelves) keep the whole stack. Plain items on the same base material place as usual. The check lives in RecoveredFindListener#onPlace.
  • Unrecovered finds follow catalog changes. A find that is still hidden, partial, discovered or lost re-picks its item from the current catalog, with the same stable seed, when the item stored on it is no longer listed. Recovered finds keep the item they became, so boards and cabinet stand-ins still match the player's piece.

The second change matters for the switch from vanilla items to MMOItems (TF-Minecraft/ServerAssets#54): TFMC Main has 642 hidden finds that store the old vanilla tokens and would otherwise keep producing them.

Tests

  • RecoveredFindListenerTest.artifactsCannotBePlacedButPlainItemsOnTheSameBaseCan
  • RecoveredFindItemTest.piecesStillInTheGroundFollowACatalogChangeButRecoveredPiecesKeepTheirItem
  • Local mvn verify on Windows: all tests pass except two SiteRepositoryTest filesystem-permission tests that fail locally without this change as well.

🤖 Generated with Claude Code

Recovered artifacts can no longer be placed as blocks. A placed block
loses the archive tag, so the player is told that artifacts only go on
displays. Item frames and shelves keep the whole stack. Plain items on
the same base material still place normally.

Finds still in the ground re-pick their item, with the same stable seed,
when the catalog no longer lists the item stored on them. Without this,
existing sites would keep producing the old vanilla items after a
catalog switch. Recovered finds keep the item they became.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nowkoo

Nowkoo commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: 16624078-cc11-4697-b6fa-109ce4ca3c00

📥 Commits

Reviewing files that changed from the base of the PR and between f6fe585 and 1854622.


📒 Files selected for processing (5)
  • src/main/java/net/tfminecraft/archaeo/config/ArtifactTemplate.java
  • src/main/java/net/tfminecraft/archaeo/item/RecoveredFindItem.java
  • src/main/java/net/tfminecraft/archaeo/item/RecoveredFindListener.java
  • src/test/java/net/tfminecraft/archaeo/item/RecoveredFindItemTest.java
  • src/test/java/net/tfminecraft/archaeo/item/RecoveredFindListenerTest.java

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



📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Recovered finds with missing or no-longer-offered items now use an item from the artifact’s current options, while recovered finds retain their stored item.
    • Recovered artifacts can no longer be placed as blocks; players are told to place them on displays instead. Ordinary items remain unaffected.

Walkthrough

The change updates item selection for unrecovered finds when catalog offerings change. It also prevents recovered finds from being placed as blocks and notifies the player when placement is blocked.

Changes

Recovered find handling

Layer / File(s) Summary
Catalog item selection
src/main/java/net/tfminecraft/archaeo/config/ArtifactTemplate.java, src/main/java/net/tfminecraft/archaeo/item/RecoveredFindItem.java, src/test/java/net/tfminecraft/archaeo/item/RecoveredFindItemTest.java
ArtifactTemplate.offers checks trimmed command tokens without regard to case. Unrecovered finds reselect an item if the template no longer offers the stored item. Tests cover selection across find states, standIn stability, and case-variant tokens.
Recovered find placement prevention
src/main/java/net/tfminecraft/archaeo/item/RecoveredFindListener.java, src/test/java/net/tfminecraft/archaeo/item/RecoveredFindListenerTest.java
The listener cancels placement of recovered finds and sends an error message. Tests check recovered and ordinary items placed from the off hand and main hand.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BlockPlaceEvent
  participant RecoveredFindListener
  participant Player
  BlockPlaceEvent->>RecoveredFindListener: onPlace(event)
  RecoveredFindListener->>BlockPlaceEvent: cancel placement
  RecoveredFindListener->>Player: send error message
Loading

Suggested reviewers: ryanbarlow97


Merge Risk: ⚪ Minimal · up to 18546

No actionable merge-blocking risk is established; the change is mergeable after normal checks.

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

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

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.

@Nowkoo
Nowkoo merged commit aab7052 into main Oct 10, 2026
2 checks passed
@Nowkoo
Nowkoo deleted the fix/artifact-placement-and-catalog-items branch October 10, 2026 19:35
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