
GriefPrevention3D
A fork of GriefPrevention that adds 3D subdivisions
Список изменений
GriefPrevention3D v18.2.1
Wiki: GriefPrevention3D Wiki
Fixes
/claimlist no longer shows duplicate claims; claim blocks no longer go negative
Fixed a bug where a player's claims could appear duplicated in /claimlist and their available claim blocks would drift negative. The issue affected players after logout or server restart (whenever their PlayerData was freshly created).
Root cause: DataStore.addClaim() added the claim to the global this.claims list first, then called ownerData.getClaims(). When the player's PlayerData was newly created (claims vector == null), getClaims() lazy-initialized by scanning this.claims — finding the same claim — then the caller added it a second time. Each duplicate caused getRemainingClaimBlocks() to subtract the claim's area twice, and /claimlist showed the claim twice.
The same bug existed in changeClaimOwner() (claim transfer).
Fix: Guard both .add() calls with a contains() check so a claim is never double-added to the owner's vector after lazy init already picked it up.
DataStore.java:addClaim()andchangeClaimOwner()now check!ownerClaims.contains(claim)before adding.
