Closed RezzedUp closed 2 years ago
Have you tested with this? When I used accrued claimblocks before, I believe someone reported the issue that GriefPrevention plugin would automatically grant players the default claim block amount when they traded down to 0 claim blocks, effectively making duplication of claim blocks possible.
Yes, I did test it. That shouldn't be an issue because it's modifying bonus claimblocks, not accrued claimblocks.
What happens if a user has 1000 bonus claim blocks, 1200 total, and they trade away all 1200? Their bonus claim blocks would be set to negative 200? Looking at the GriefPrevention code, it looks like this would still trigger the plugin to give them new claim blocks.
Looking at the GriefPrevention code, it looks like this would still trigger the plugin to give them new claim blocks.
Not quite sure where you're seeing that because it only adjusts accrued claimblocks if they're less than the config's default value. Bonus claimblocks are a separate value and aren't affected by that.
GriefPrevention calculates remaining claimblocks by adding accrued claimblocks with bonus claimblocks, and since bonus claimblocks can be negative (and aren't reset to a minimum amount), subtracting traded claimblocks from the bonus amount works as intended. Here are a few screenshots of a trade in action:
I was mistaken when looking at the GriefPrevention code, I was seeing a section which restored claim blocks to a player when their total claimed land exceeded their total claim blocks.
This patch allows players to trade their accrued claimblocks once again, instead of just their bonus claimblocks. It also fixes several issues with building the plugin (by updating/removing improperly-defined and unused dependencies).