Skip to content

Prevent Boxed from resetting player progress on non-Boxed island resets#125

Merged
tastybento merged 2 commits into
developfrom
copilot/box-reset-stats-and-achievements
May 29, 2026
Merged

Prevent Boxed from resetting player progress on non-Boxed island resets#125
tastybento merged 2 commits into
developfrom
copilot/box-reset-stats-and-achievements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

Boxed was clearing player advancements/statistics on IslandNewIslandEvent even when the reset originated from a non-Boxed island. This leaked Boxed reset behavior across game modes.

  • Event scoping fix

    • Added a world-scope guard in AdvancementListener#onFirstTime to no-op unless the event island belongs to a Boxed world.
    • This keeps reset-side advancement/stat clearing confined to Boxed islands only.
  • Regression coverage

    • Added a listener test that simulates IslandNewIslandEvent for a non-Boxed island and asserts the reset flow is not entered (no player UUID access / no clear path trigger).
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onFirstTime(IslandNewIslandEvent e) {
    if (addon.getSettings().isIgnoreAdvancements()) return;
    if (!addon.inWorld(e.getIsland().getWorld())) {
        return;
    }
    User user = User.getInstance(e.getPlayerUUID());
    if (user != null) {
        clearAndSetAdv(user, addon.getSettings().isOnJoinResetAdvancements(),
                addon.getSettings().getOnJoinGrantAdvancements());
    }
}

The floating jitpack snapshot v1.21-SNAPSHOT resolves to an ephemeral
git-described build whose jar/POM get evicted, breaking CI even on
unchanged commits. Switch to the equivalent stable Maven Central
coordinates (org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.110.0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit 0cb50ff into develop May 29, 2026
3 checks passed
@tastybento tastybento deleted the copilot/box-reset-stats-and-achievements branch May 29, 2026 23:21
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.

2 participants