Skip to content

feat: draw output aspects from a random pool - #12

Merged
XxFran10xX merged 2 commits into
mainfrom
feat/aspect-pool
Oct 17, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
feat/aspect-pool

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Shaymin's request: runestone research should not need the same aspects every time. An output can now list an aspect_pool and a pick count. Each new project draws that many distinct aspects from the pool, at random, and adds them to the output's fixed aspects (which stay optional).

This only adds a new, optional config key. No existing config file or default changes.

a_minor_runestone:
  # ...displays, product_reveal and result as before...
  aspects:            # optional: always required
    magic:
      required_points: 4
  aspect_pool:
    pick: 3           # draw 3 of these per project
    aspects:
      earth:  {required_points: 3}
      nature: {required_points: 3}
      fire:   {required_points: 3}
      ice:    {required_points: 3}
      water:  {required_points: 3}
      air:    {required_points: 3}
  • Draws are made when the project starts and saved with the station (pool_aspects), so they survive restarts. Pool aspects that were not drawn count as off-recipe and are rejected like any other wrong aspect.
  • Loader validation: pick must be between 1 and the pool size. A pool aspect must exist, need more than 0 points, and not also be a fixed aspect. Fixed aspects plus pick must fit the 6 GUI rows.
  • Old saves and pool edits: on load, draws that are no longer in the pool are replaced from it, and the plugin logs a warning. A station started before a pool was added gets its draws on load.
  • New draws on load prefer aspects the station has not already rejected (it may have rejected them while they were off-recipe). If only rejected ones are left, the drawn aspect's state and points are cleared so the project can still finish.
  • Outputs without aspect_pool behave exactly as before.
  • Known limit: after /research reload, a running station keeps its current draws until the next restart. Fixed aspects already behave the same way.

Tests

  • mvn verify on Linux CI passes (311 tests, coverage gate met). New tests cover loading and validation, draws and reconciliation (including the rejected-aspect preference), persistence, and the manager flow. On Windows, 31 of main's save/estate tests fail because DurableFiles cannot fsync a folder there; they fail on main too and pass on Linux.
  • TFMCDev01 bot test with a real character (temporary zz_pool_test output: fixed metal + pick 3 of earth/nature/fire/ice/water/air):
    • On the released 1.3.2 jar, two stations were started and pool aspects were rejected by real experiments (L1: earth/nature/fire; L2: earth/nature/fire/water). Their saves had no pool_aspects.
    • On this build, L1 drew exactly [ice, air, water], the only aspects it had not rejected. L2 drew ice + air + water, which had been rejected. Water's state and points were cleared, it confirmed again and the research completed. Both stations kept their other rejections, and their GUI rows were metal + the draws.
    • Two new projects drew earth+fire+nature and fire+ice+air. The GUI rows were metal + the draws, an undrawn pool aspect stayed TESTING at 2 points, and the drawn aspects completed the research.
    • No Research errors in the log. The temporary configs, stations and test platform were removed afterwards.

Docs: TF-Minecraft/Docs projects/Research/overview.md (outputs config row) should get the aspect_pool keys once this is merged.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 11, 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: 41452a7a-a89b-47e8-aad3-9296ac785cd4
📥 Commits

Reviewing files that changed from the base of the PR and between 940d5d0 and d393bdf.

📒 Files selected for processing: 15
  • README.md
  • src/main/java/net/tfminecraft/research/database/StationSaveData.java
  • src/main/java/net/tfminecraft/research/database/StationStore.java
  • src/main/java/net/tfminecraft/research/loader/OutputLoader.java
  • src/main/java/net/tfminecraft/research/manager/InventoryManager.java
  • src/main/java/net/tfminecraft/research/manager/ResearchManager.java
  • src/main/java/net/tfminecraft/research/model/ActiveProject.java
  • src/main/java/net/tfminecraft/research/model/OutputDef.java
  • src/main/java/net/tfminecraft/research/util/AspectSlotOrder.java
  • src/main/java/net/tfminecraft/research/util/RevealHelper.java
  • src/test/java/net/tfminecraft/research/database/ResearchPersistenceTest.java
  • src/test/java/net/tfminecraft/research/loader/ResearchLoadersTest.java
  • src/test/java/net/tfminecraft/research/manager/ResearchManagerTest.java
  • src/test/java/net/tfminecraft/research/model/AspectPoolTest.java
  • src/test/java/net/tfminecraft/research/util/ResearchUtilitiesTest.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

  • New Features
    • Projects can now draw a configured number of aspects from an aspect pool when they start. The selected aspects are included in the project’s research requirements and saved across restarts.
  • Bug Fixes
    • Research progress and aspect slots now reflect the aspects selected for each project, rather than every aspect available in its output.
    • Saved selections are reconciled with current pool settings; newly drawn aspects have their previous research state and points cleared.
  • Documentation
    • Added guidance on configuring aspect pools and selection counts.

Output definitions can specify an aspect pool and a selection count. Projects select and persist pool aspects, then use those selections in recipe requirements, slot assignments, and research checks. Loading validates pool configuration and reconciles saved selections.

Changes: Project Aspect Pools

Layer / File(s) Summary
Define and select project aspects
README.md, src/main/java/net/tfminecraft/research/model/OutputDef.java, src/main/java/net/tfminecraft/research/model/ActiveProject.java, src/test/java/net/tfminecraft/research/model/AspectPoolTest.java
Output definitions load, draw, and reconcile pool aspects. Projects store distinct selections. Tests cover selection, reconciliation, and recipe aspects; the README describes the pool configuration.
Validate pool configuration
src/main/java/net/tfminecraft/research/loader/OutputLoader.java, src/test/java/net/tfminecraft/research/loader/ResearchLoadersTest.java
Output loading validates pool entries, pick counts, overlap with fixed aspects, and the combined GUI row limit. Tests cover valid and invalid configurations.
Use selected aspects in research
src/main/java/net/tfminecraft/research/manager/ResearchManager.java, src/main/java/net/tfminecraft/research/manager/InventoryManager.java, src/main/java/net/tfminecraft/research/util/AspectSlotOrder.java, src/main/java/net/tfminecraft/research/util/RevealHelper.java, src/test/java/net/tfminecraft/research/manager/ResearchManagerTest.java, src/test/java/net/tfminecraft/research/util/ResearchUtilitiesTest.java
Project start selects pool aspects before building slot assignments. Inventory display and research checks use the project’s recipe aspects. Tests cover project starts and research progress.
Persist and reconcile project selections
src/main/java/net/tfminecraft/research/database/StationSaveData.java, src/main/java/net/tfminecraft/research/database/StationStore.java, src/test/java/net/tfminecraft/research/database/ResearchPersistenceTest.java
Station data stores pool selections. Loading reconciles selections and slot assignments with the current recipe. Persistence tests cover restart, stale selections, and retained research state.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ResearchManager
  participant OutputDef
  participant ActiveProject
  participant AspectSlotOrder
  ResearchManager->>OutputDef: rollPoolAspects()
  OutputDef-->>ResearchManager: selected aspect IDs
  ResearchManager->>ActiveProject: setPoolAspects()
  ResearchManager->>OutputDef: getRecipeAspects(project)
  OutputDef-->>ResearchManager: fixed and selected requirements
  ResearchManager->>AspectSlotOrder: buildRowAssignments(recipe aspect IDs)
Loading

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to d393b

The reviewed change is mergeable after normal checks; no outstanding behavior issue was established.

- [ ] 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.

XxFran10xX and others added 2 commits October 17, 2026 17:49
Outputs can list an aspect_pool with a pick count. Each new project
draws that many distinct aspects from the pool and adds them to the
output's fixed aspects, so the same research needs different aspects
each time. Draws are saved with the station; on load, draws that left
the pool are replaced from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A station loaded before its output had a pool (or after a pool edit) gets
new draws. Prefer aspects it has not rejected while they were off-recipe,
and clear the state of any rejected aspect it still has to draw, so the
project can always finish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Oct 17, 2026
@XxFran10xX
XxFran10xX marked this pull request as ready for review October 17, 2026 16:02
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 17, 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.

@XxFran10xX
XxFran10xX merged commit 5de5a7c into main Oct 17, 2026
4 checks passed
@XxFran10xX
XxFran10xX deleted the feat/aspect-pool branch October 17, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant