Fix banPlayer(OfflinePlayer) trusting instead of banning#187
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IslandInfo.banPlayer(OfflinePlayer)(single-arg) delegated totrustPlayer(target, null)instead ofbanPlayer(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. CompareunbanPlayer(OfflinePlayer), which correctly forwards tounbanPlayer(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.🤖 Generated with Claude Code