From 70469d1b4c5295df20b94eff7bd2e639dbf5238a Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jan 2017 18:34:44 -0600 Subject: [PATCH] Fix idle detection when other plugins handle AccrueClaimBlocksEvent (#71) --- .../DeliverClaimBlocksTask.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/DeliverClaimBlocksTask.java b/src/me/ryanhamshire/GriefPrevention/DeliverClaimBlocksTask.java index 538134c..bc31e2b 100644 --- a/src/me/ryanhamshire/GriefPrevention/DeliverClaimBlocksTask.java +++ b/src/me/ryanhamshire/GriefPrevention/DeliverClaimBlocksTask.java @@ -83,16 +83,18 @@ class DeliverClaimBlocksTask implements Runnable if (event.isCancelled()) { GriefPrevention.AddLogEntry(player.getName() + " claim block delivery was canceled by another plugin.", CustomLogEntryTypes.Debug, true); - return; } - accrualRate = event.getBlocksToAccrue(); - if(accrualRate < 0) accrualRate = 0; - playerData.accrueBlocks(accrualRate); - GriefPrevention.AddLogEntry("Delivering " + event.getBlocksToAccrue() + " blocks to " + player.getName(), CustomLogEntryTypes.Debug, true); - - //intentionally NOT saving data here to reduce overall secondary storage access frequency - //many other operations will cause this player's data to save, including his eventual logout - //dataStore.savePlayerData(player.getUniqueIdentifier(), playerData); + else + { + accrualRate = event.getBlocksToAccrue(); + if (accrualRate < 0) accrualRate = 0; + playerData.accrueBlocks(accrualRate); + GriefPrevention.AddLogEntry("Delivering " + event.getBlocksToAccrue() + " blocks to " + player.getName(), CustomLogEntryTypes.Debug, true); + + //intentionally NOT saving data here to reduce overall secondary storage access frequency + //many other operations will cause this player's data to save, including his eventual logout + //dataStore.savePlayerData(player.getUniqueIdentifier(), playerData); + } } else {