Skip to content

Fix purge regions: nether detection, login check inversion, and scan report#2841

Merged
tastybento merged 1 commit intodevelopfrom
fix/purge-regions-nether-login-check-report
Mar 13, 2026
Merged

Fix purge regions: nether detection, login check inversion, and scan report#2841
tastybento merged 1 commit intodevelopfrom
fix/purge-regions-nether-login-check-report

Conversation

@tastybento
Copy link
Member

@tastybento tastybento commented Mar 13, 2026

Summary

  • Nether/End detection: isNether/isEnd were evaluated once at constructor time before IWM had loaded the addon world config, causing the Nether to always appear disabled. Now evaluated at the start of findIslands() each run.
  • Login check inversion: canDeleteIsland() had the recent-login branch returning false ("can delete") instead of true ("cannot delete"), and used findFirst() instead of anyMatch() so only the first team member was checked — entire teams were not protected.
  • Scan report: Replace the silent removeIf filter with an explicit iterator loop that counts and reports how many islands are blocked by level threshold vs. purge protection flags.
  • UX: Add an immediate "please wait" notice right after the candidate count is logged, before the multi-second freshness/island check begins.
  • Tests: Update the bug-documenting test to assert the now-correct behaviour — an island whose member logged in recently is excluded from purge.

Test plan

  • Run ./gradlew test --tests "world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeRegionsCommandTest"
  • Verify that islands with a recently-logged-in member are excluded from purge
  • Verify that nether/end world detection works correctly after addon world config loads
  • Verify the scan report output shows counts for level-blocked and protection-blocked islands

🤖 Generated with Claude Code

…can report

- isNether/isEnd were computed once at constructor time before IWM had
  loaded the addon world config, causing the Nether to always appear
  disabled. Now evaluated at the start of findIslands() each run.

- canDeleteIsland() had the recent-login branch returning false ("can
  delete") instead of true ("cannot delete"), and used findFirst()
  instead of anyMatch() so only the first team member was checked.

- Replace the removeIf filter with an explicit iterator loop that
  counts islands blocked by level threshold and purge protection, and
  reports how many regions each prevents from being purged.

- Add an immediate "please wait" notice right after the candidate count
  is logged, before the multi-second freshness/island check begins.

- Update the bug-documenting test to assert the now-correct behaviour:
  an island whose member logged in recently is excluded from purge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

@tastybento tastybento merged commit 0eb0142 into develop Mar 13, 2026
3 checks passed
@tastybento tastybento deleted the fix/purge-regions-nether-login-check-report branch March 13, 2026 02:41
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