Skip to content

feat: per-world team disable + admin team disbandall (#2965)#2975

Merged
tastybento merged 1 commit into
developfrom
feature/2965-disable-teams
May 9, 2026
Merged

feat: per-world team disable + admin team disbandall (#2965)#2975
tastybento merged 1 commit into
developfrom
feature/2965-disable-teams

Conversation

@tastybento
Copy link
Copy Markdown
Member

Summary

  • Adds WorldSettings#isTeamsDisabled() (default false) and IslandWorldManager#isTeamsDisabled(World) so game modes can switch off the team subsystem per world. When enabled, island team invite/accept/kick/leave/promote/demote/setowner and admin team add refuse with commands.island.team.errors.teams-disabled. Trust/coop/untrust/uncoop are intentionally unaffected.
  • Adds admin team disbandall to strip every member and sub-owner from every island in the world (trusted/coop players preserved), for cleaning up pre-existing teams when flipping the flag on.
  • Locale entries for the new error and disbandall command, plus tests for AdminTeamAddCommand, IslandTeamInviteCommand, and the new AdminTeamDisbandAllCommand.

Closes #2965.

Test plan

  • ./gradlew test --tests "world.bentobox.bentobox.api.commands.admin.team.*" --tests "world.bentobox.bentobox.api.commands.island.team.IslandTeamInviteCommandTest"
  • In a game mode that sets isTeamsDisabled() == true, verify /is team invite and admin team add are refused with the new message
  • Verify trust, coop, untrust, uncoop still work in that world
  • Run admin team disbandall, confirm with the printed token, and verify members/sub-owners are removed while trusted/coop relationships survive

🤖 Generated with Claude Code

Introduces WorldSettings#isTeamsDisabled() so game modes can opt out of
the team subsystem on a per-world basis. When enabled, every island/admin
team sub-command except trust, coop, untrust and uncoop refuses to run
and surfaces commands.island.team.errors.teams-disabled. Trust and coop
relationships remain available as the supported alternative.

Adds the admin team disbandall command for stripping pre-existing team
members and sub-owners from every island in a world when flipping the
flag on. Trusted and coop players are left alone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

@tastybento tastybento merged commit ce82a57 into develop May 9, 2026
3 checks passed
@tastybento tastybento deleted the feature/2965-disable-teams branch May 9, 2026 22:15
tastybento added a commit that referenced this pull request May 9, 2026
- AdminTeamDisbandAllCommandTest: replace any(Long.class) with anyLong()
  to avoid an autounbox NPE during Mockito stubbing.
- Sync the four keys added in #2975 (admin team disbandall.{description,
  confirmation,success} + island team errors.teams-disabled) into all 22
  bundled locales so non-English servers don't surface raw keys.
- Tighten WorldSettings#isTeamsDisabled() Javadoc to list the commands
  actually blocked rather than the broader "every island team *" claim,
  and to call out that read-only commands and trust/coop are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Config option to fully disable the team subsystem (members only; keep trusted/coop)

1 participant