Skip to content

Fix ChunkBlock top ten showing AOneBlock players - #16

Merged
tastybento merged 1 commit into
developfrom
fix/cross-gamemode-topten
Aug 21, 2026
Merged

Fix ChunkBlock top ten showing AOneBlock players#16
tastybento merged 1 commit into
developfrom
fix/cross-gamemode-topten

Conversation

@tastybento

Copy link
Copy Markdown
Member

Summary

  • Root cause fix: Both AOneBlock and ChunkBlock use OneBlockIslands as their database class name. BentoBox's JSON handler uses getSimpleName() to determine storage, so both share database/OneBlockIslands/. Added a hook.getGameMode().inWorld(island.getWorld()) filter in refresh() so only islands from the correct game mode appear in each top ten.
  • Steve heads fix: If an admin's top_panel.yml has icon: PLAYER_HEAD uncommented, builder.icon(ItemStack) doesn't set playerHeadName, so HeadGetter was never invoked. Now skips PLAYER_HEAD template icons and falls through to the name-based head path.
  • Pladdon resilience: Catches LinkageError in onEnable() when constructing hooks, and adds softdepend entries in plugin.yml for game mode Pladdon names so class loading works across plugin loaders.

Test plan

  • All 44 existing tests pass
  • New test testRefreshFiltersIslandsFromWrongGameMode verifies islands from a different game mode's world are excluded
  • Manual: run a server with both AOneBlock and ChunkBlock, verify /chunkblock topblock shows only ChunkBlock players
  • Manual: verify player heads show skins, not Steve

🤖 Generated with Claude Code

https://claude.ai/code/session_01WwpMcJAhXEWeFwtRwg1uNy

Both AOneBlock and ChunkBlock use OneBlockIslands as their database
class name. BentoBox's JSON handler keys on getSimpleName(), so both
game modes share the same database/OneBlockIslands/ folder. When
TopBlock refreshes ChunkBlock's data, handler.loadObjects() returns
all records including AOneBlock's, causing AOneBlock players to appear
in the ChunkBlock panel.

Fix by filtering islands in refresh() with
hook.getGameMode().inWorld(island.getWorld()) so only islands belonging
to the correct game mode are included. Also guard the panel icon path
against customised templates where icon: PLAYER_HEAD is uncommented —
builder.icon(ItemStack) does not set playerHeadName, so HeadGetter was
never invoked and heads stayed as Steve.

Additionally, catch LinkageError in onEnable() when constructing game
mode hooks, and add softdepend entries in plugin.yml for the Pladdon
plugin names so class loading works across plugin loaders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WwpMcJAhXEWeFwtRwg1uNy
@tastybento
tastybento merged commit af88dfb into develop Aug 21, 2026
1 check passed
@tastybento
tastybento deleted the fix/cross-gamemode-topten branch August 21, 2026 01:20
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento mentioned this pull request Aug 21, 2026
3 tasks
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