Repository navigation
perf: look only at pedestals when finding a meditation circle - #73
Conversation
Every tick, each player sitting anywhere (chairs, horses, boats) checks for a circle around the seat. The check now keeps only the uncarried pedestals from the nearby chunks, and stops when there are fewer of them than the ring has posts, since each post needs a pedestal of its own. The posts are matched exactly as before, so a circle forms and meditation starts on the same tick, with the same messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Filter candidates and match ring positions src/main/java/net/tfminecraft/magic/meditation/MeditationCircle.java |
The nearby-furniture helper is renamed to nearbyPedestals and collects only uncarried furniture with the configured pedestal ID. Detection returns null when the candidate count is below the number of ring positions. matchAt skips furniture already matched. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
- TF-Minecraft/Magic#66: This PR also changes
MeditationCircle’s nearby-furniture scan by adding unloaded-chunk checks tocollectNearby.
Suggested reviewers: ryanbarlow97
Merge Risk: 
Minimal · up to 77709
-
No concrete merge-blocking issue was found in the changed meditation detection path.
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.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai review |
✅ Action performed
|
Why
Main profiles, 22 hourly spark dumps 10-29 07:00 → 10-30 05:00 (peak ~30 players, ~23 ms/tick total).
MeditationService.tickcost 0.62 ms/tick at peak. Every tick, every player sitting in any vehicle (chairs, horses, carts) runstryStart → MeditationCircle.detect → collectNearby, which asked InteractibleFurniture for 9 chunks. Each IF call walked all placed furniture.Change
MeditationCircle.detectkeeps only uncarried pedestals from the 9 chunks. It returns null early when there are fewer pedestals than the ring has posts. Posts are matched as before.MeditationServiceis unchanged: the start tick, check order andnotifySitmessages stay the same. No seat cache: IF fires no event when a piece is picked up or carried, so a cache couldn't be invalidated safely.perf/furniture-chunk-index).Testing
main(Windows-only gear store and profile file tests). The meditation package is at 100% coverage.feat/bloodmagic-progression+ this commit (cherry-picked cleanly; 923 tests, same Windows failures). Two bots seated in minecarts: meditation stays idle, with no furniture walks in the profile.🤖 Generated with Claude Code