From 261620747eac298997600035d947992ea1c1a123 Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Fri, 24 Feb 2017 12:48:59 -0800 Subject: [PATCH] more debug logging --- src/me/ryanhamshire/GriefPrevention/PlayerData.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerData.java b/src/me/ryanhamshire/GriefPrevention/PlayerData.java index 1f5a775..5a17365 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerData.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerData.java @@ -302,13 +302,19 @@ public class PlayerData this.accruedClaimBlocks = totalClaimsArea; int accruedLimit = this.getAccruedClaimBlocksLimit(); this.accruedClaimBlocks = Math.min(accruedLimit, this.accruedClaimBlocks); - + GriefPrevention.AddLogEntry("New accrued blocks: " + this.accruedClaimBlocks, CustomLogEntryTypes.Debug, true); + //if that didn't fix it, then make up the difference with bonus blocks totalBlocks = this.accruedClaimBlocks + this.getBonusClaimBlocks() + GriefPrevention.instance.dataStore.getGroupBonusBlocks(this.playerID); + GriefPrevention.AddLogEntry("New total blocks: " + totalBlocks, CustomLogEntryTypes.Debug, true); if(totalBlocks < totalClaimsArea) { - this.bonusClaimBlocks += totalClaimsArea - totalBlocks; + int bonusBlocksToAdd = totalClaimsArea - totalBlocks; + this.bonusClaimBlocks += bonusBlocksToAdd; + GriefPrevention.AddLogEntry("Accrued blocks weren't enough. Adding" + bonusBlocksToAdd, CustomLogEntryTypes.Debug, true); } + GriefPrevention.AddLogEntry(player.getName() + " Accrued blocks: " + this.getAccruedClaimBlocks() + " Bonus blocks" + this.getBonusClaimBlocks(), CustomLogEntryTypes.Debug, true); + GriefPrevention.AddLogEntry("Total blocks: " + totalBlocks + " Total claimed area: " + totalClaimsArea, CustomLogEntryTypes.Debug, true); } }