Skip to content

feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration + Fix User Caching#495

Open
djoey123 wants to merge 6 commits into
WiIIiam278:masterfrom
ContentVeen:master
Open

feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration + Fix User Caching#495
djoey123 wants to merge 6 commits into
WiIIiam278:masterfrom
ContentVeen:master

Conversation

@djoey123

@djoey123 djoey123 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Add a dedicated Bukkit event that fires when players receive hourly
claim blocks, allowing booster plugins like AxBoosters to modify
the amount via reflection (getPlayer/getAmount/setAmount).

The event fires on the main thread before blocks are granted, and
the boosted amount flows through the existing max claim blocks cap.

  Add a dedicated Bukkit event that fires when players receive hourly
  claim blocks, allowing booster plugins like AxBoosters to modify
  the amount via reflection (getPlayer/getAmount/setAmount).

  The event fires on the main thread before blocks are granted, and
  the boosted amount flows through the existing max claim blocks cap.
BukkitUserProvider.getOnlineUser(Player) returned cached BukkitUser
without verifying it wrapped the current Player object. After a
cross-server proxy switch where the previous session's PlayerQuitEvent
fires late or is dropped, the cache still held a BukkitUser with a
detached Player reference. All subsequent lookups (placeholders,
permission checks, claim ownership, event dispatch) operated on the
offline Player, causing frozen scoreboard claim info, "no permission"
errors on commands like /ignoreclaims, and empty placeholder output
until relog. Mirrors the existing FabricUserProvider guard.
ClaimWorld.userCache (UUID -> name, persisted) was only written by cacheUser() during claim create/trust/ban/transfer. The join path updated the SavedUser record but never the per-world username cache, so claim owner placeholders (CURRENT_CLAIM_OWNER) kept showing the old name after a player changed their Minecraft name mid-session. Workaround was transferring the claim away and back.

Add ClaimWorld.refreshUserName, called from onUserJoin, which updates only already-cached users (owners/trustees) and persists worlds whose name actually changed.
@djoey123 djoey123 changed the title feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration + Fix User Caching May 25, 2026
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