Skip to content

perf: look only at pedestals when finding a meditation circle - #73

Merged
XxFran10xX merged 1 commit into
mainfrom
perf/furniture-chunk-index
Oct 30, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
perf/furniture-chunk-index

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Why

Main profiles, 22 hourly spark dumps 10-29 07:00 → 10-30 05:00 (peak ~30 players, ~23 ms/tick total). MeditationService.tick cost 0.62 ms/tick at peak. Every tick, every player sitting in any vehicle (chairs, horses, carts) runs tryStart → MeditationCircle.detect → collectNearby, which asked InteractibleFurniture for 9 chunks. Each IF call walked all placed furniture.

Change

  • MeditationCircle.detect keeps 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.
  • MeditationService is unchanged: the start tick, check order and notifySit messages 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.
  • Most of the win comes from InteractibleFurniture's chunk index (TF-Minecraft/InteractibleFurniture perf/furniture-chunk-index).

Testing

  • 731 tests locally; the 155 failures are the same set as main (Windows-only gear store and profile file tests). The meditation package is at 100% coverage.
  • Dev (10-30, 11:55–16:47 UTC): all ten perf branches from this round ran together (InteractibleFurniture, Cooking, Magic, RPCharacters, Thievery, VFBuilders, SimpleFactions, Archaeo, VehicleFramework, TrialRooms). Bot probes ran on these jars and again on the previous jars for comparison. No errors from any of the ten plugins in the log, including through a scheduled restart. Dev runs the Blood Magic branch, so the Dev jar was 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

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>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57bf4c07-4314-496c-9fdf-581d77575075
Commits

Reviewing files that changed from the base of the PR and between 53403a6 and 77709fb.

Files selected for processing: 1
  • src/main/java/net/tfminecraft/magic/meditation/MeditationCircle.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
    • Improved meditation circle detection so only nearby, uncarried pedestals are considered. Detection now stops when there are not enough pedestals to form the circle.

MeditationCircle.detect now gathers nearby, uncarried furniture with the configured pedestal ID. It returns null when fewer candidates exist than ring positions. matchAt uses the filtered candidates and skips furniture already matched.

Changes: Meditation pedestal detection

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: Low

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 to collectNearby.

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to 77709

No concrete merge-blocking issue was found in the changed meditation detection path.

- [ ] 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:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 30, 2026
@XxFran10xX
XxFran10xX marked this pull request as ready for review October 30, 2026 17:28
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 30, 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 08935d4 into main Oct 30, 2026
4 checks passed
@XxFran10xX
XxFran10xX deleted the perf/furniture-chunk-index branch October 30, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant