Skip to content

Fix banPlayer(OfflinePlayer) trusting instead of banning#187

Merged
minoneer merged 1 commit into
4.0from
fix/banplayer-single-arg
Jul 16, 2026
Merged

Fix banPlayer(OfflinePlayer) trusting instead of banning#187
minoneer merged 1 commit into
4.0from
fix/banplayer-single-arg

Conversation

@minoneer

Copy link
Copy Markdown
Member

IslandInfo.banPlayer(OfflinePlayer) (single-arg) delegated to trustPlayer(target, null) instead of banPlayer(target, null) — a copy-paste error, so it trusted the target instead of banning them.

It's a public API method (api/IslandInfo.java), so third-party plugins calling the single-arg form were affected. Internally uSkyBlock only uses the two-arg overload (correct), which is why this went unnoticed. Compare unbanPlayer(OfflinePlayer), which correctly forwards to unbanPlayer(target, null).

Surfaced while writing the party/membership unit tests (#186). One-line fix plus IslandInfoBanTest, which asserts the single-arg overload bans (isBanned) and does not trust (isTrusted) — it fails against the old code and passes against the fix.

Validation

./gradlew :uSkyBlock-Core:test — BUILD SUCCESSFUL.

Committed --no-gpg-sign (1Password signing agent locked mid-session).

🤖 Generated with Claude Code

The single-argument IslandInfo.banPlayer(OfflinePlayer) overload delegated to
trustPlayer(target, null) instead of banPlayer(target, null) - a copy-paste
error - so it added the target as a trustee rather than banning them. It is a
public API method (api.IslandInfo), so third-party callers of the single-arg form
were affected; internally uSkyBlock uses the two-arg overload, which is correct
(mirrors unbanPlayer(OfflinePlayer) -> unbanPlayer(target, null)).

Found while adding party/membership unit tests. Adds IslandInfoBanTest asserting
the single-arg overload bans (isBanned) and does not trust (isTrusted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@minoneer
minoneer merged commit 2494e5e into 4.0 Jul 16, 2026
5 checks passed
@minoneer
minoneer deleted the fix/banplayer-single-arg branch July 16, 2026 07:20
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