feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration + Fix User Caching#495
Open
djoey123 wants to merge 6 commits into
Open
feat: add BukkitHourlyClaimBlocksEvent for AxBoosters integration + Fix User Caching#495djoey123 wants to merge 6 commits into
djoey123 wants to merge 6 commits into
Conversation
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.
…umbers and shorter playtime
…umbers and shorter playtime
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.
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.