Skip to content

Add a global hunt mode and restore the 2500-block detection range - #31

Merged
ryanbarlow97 merged 1 commit into
mainfrom
feat/hunt-mode
Oct 16, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
feat/hunt-mode

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Adds a server-wide switch between a cache per character and one shared cache, and puts the detection range back to 2,500 blocks.

source.mode: player is the current behaviour. source.mode: global buries one cache anywhere inside the configured area, read by every hunter holding a live detector; the first to open it takes the loot and the next hold buries a new one anywhere in the area. The shared cache is not re-rolled by distance. Collection limits stay per account in both modes. /geiger mode [player|global] shows or switches the mode, saving it to config.yml and reloading. The shared cache is kept in sources.yml under its own key, so switching back to player mode resumes every character's old hunt.

In global mode /geiger locate (console too) and /geiger move [x z] act on the shared cache, with their own admin.shared-* messages; tab completion follows the mode.

detection.max-detection-distance defaults to 2500. Config v8 adds source.mode and raises the range from 1000 to 2500 where it was still at that value. The v6 step that capped the range at reroll-distance is removed, since v8 would undo it.

Docs: TF-Minecraft/Docs#275.

Tests: mvn clean verify passes, 170 tests at 100% coverage.

🤖 Generated with Claude Code

source.mode picks who hunts which source. player keeps a cache per
character near them; global buries one cache anywhere in the area that
every hunter reads, and the first to open it takes the loot before a new
one is buried. /geiger mode [player|global] shows or switches the mode,
saved to config.yml. Each mode keeps its own sources in sources.yml, so
switching back resumes the old hunts. In global mode /geiger locate and
/geiger move [x z] act on the shared cache.

detection.max-detection-distance defaults to 2500 again. Config v8 adds
source.mode and raises the range from 1000 to 2500 where it was still at
that value; the v6 cap at reroll-distance is gone.

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 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 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: 8a56b4ce-0248-4afb-9a4c-77a6f3d5c117
📥 Commits

Reviewing files that changed from the base of the PR and between 752d832 and 339c3a8.

📒 Files selected for processing: 14
  • README.md
  • src/main/java/net/tfminecraft/geigercounters/commands/GeigerCommand.java
  • src/main/java/net/tfminecraft/geigercounters/config/ConfigMigrator.java
  • src/main/java/net/tfminecraft/geigercounters/config/GeigerConfiguration.java
  • src/main/java/net/tfminecraft/geigercounters/handlers/SourceHandler.java
  • src/main/java/net/tfminecraft/geigercounters/managers/GeigerManager.java
  • src/main/resources/config.yml
  • src/main/resources/messages.yml
  • src/main/resources/plugin.yml
  • src/test/java/net/tfminecraft/geigercounters/commands/GeigerCommandTest.java
  • src/test/java/net/tfminecraft/geigercounters/config/ConfigMigratorTest.java
  • src/test/java/net/tfminecraft/geigercounters/config/GeigerConfigurationTest.java
  • src/test/java/net/tfminecraft/geigercounters/handlers/SourceHandlerTest.java
  • src/test/java/net/tfminecraft/geigercounters/managers/GeigerManagerTest.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
    • Added a global hunt mode where hunters share one cache. Administrators can check or change the mode and locate, move or clear the shared source.
  • Changes
    • Increased the default maximum detection distance from 1,000 to 2,500 blocks. Existing configurations using the previous default are updated during migration.
    • Global sources can appear anywhere in the configured area and are not rerolled based on distance.

The pull request adds a configurable global hunt mode that uses a shared source and cache. It updates source placement and manager ownership, adds commands to select the mode and manage the shared source, and advances configuration migration to version 8.

Changes: Global hunt mode

Layer / File(s) Summary
Hunt mode configuration and migration
src/main/java/net/tfminecraft/geigercounters/config/GeigerConfiguration.java, src/main/java/net/tfminecraft/geigercounters/config/ConfigMigrator.java, src/main/resources/config.yml, src/test/java/net/tfminecraft/geigercounters/config/*
Configuration supports player and global modes. Migration advances to version 8, raises the detection-distance default from 1,000 to 2,500 when the existing value is exactly 1,000, and no longer caps that value at the reroll distance.
Shared-source placement and ownership
src/main/java/net/tfminecraft/geigercounters/handlers/SourceHandler.java, src/main/java/net/tfminecraft/geigercounters/managers/GeigerManager.java, src/test/java/net/tfminecraft/geigercounters/handlers/SourceHandlerTest.java, src/test/java/net/tfminecraft/geigercounters/managers/GeigerManagerTest.java
SourceHandler can place the shared source anywhere in the configured area. In global mode, GeigerManager uses the shared source for player checks, cache opening and protected-ground handling.
Mode and shared-source commands
src/main/java/net/tfminecraft/geigercounters/commands/GeigerCommand.java, src/main/resources/messages.yml, src/main/resources/plugin.yml, README.md, src/test/java/net/tfminecraft/geigercounters/commands/GeigerCommandTest.java
/geiger mode reports or changes the mode. Global-mode locate and move target the shared source, with mode-aware coordinate completion and command messages.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Hunter
  participant GeigerManager
  participant SourceHandler
  Hunter->>GeigerManager: Request a geiger check
  GeigerManager->>SourceHandler: placeAnywhere(SHARED) when placement is needed
  SourceHandler-->>GeigerManager: Return the shared source location
  GeigerManager-->>Hunter: Provide a reading from the shared source
Loading
Merge Risk: ⚪ Minimal · up to 339c3

The change adds a global hunt mode and restores the 2,500-block default detection range. No merge-blocking risk is evident from the supplied context.

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

@ryanbarlow97
ryanbarlow97 merged commit f96d5b3 into main Oct 16, 2026
3 checks passed
@ryanbarlow97
ryanbarlow97 deleted the feat/hunt-mode branch October 16, 2026 10:10
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