Fix idle detection when other plugins handle AccrueClaimBlocksEvent (#71)
This commit is contained in:
parent
e5d81e76a2
commit
70469d1b4c
|
|
@ -83,10 +83,11 @@ class DeliverClaimBlocksTask implements Runnable
|
||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
{
|
{
|
||||||
GriefPrevention.AddLogEntry(player.getName() + " claim block delivery was canceled by another plugin.", CustomLogEntryTypes.Debug, true);
|
GriefPrevention.AddLogEntry(player.getName() + " claim block delivery was canceled by another plugin.", CustomLogEntryTypes.Debug, true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
accrualRate = event.getBlocksToAccrue();
|
accrualRate = event.getBlocksToAccrue();
|
||||||
if(accrualRate < 0) accrualRate = 0;
|
if (accrualRate < 0) accrualRate = 0;
|
||||||
playerData.accrueBlocks(accrualRate);
|
playerData.accrueBlocks(accrualRate);
|
||||||
GriefPrevention.AddLogEntry("Delivering " + event.getBlocksToAccrue() + " blocks to " + player.getName(), CustomLogEntryTypes.Debug, true);
|
GriefPrevention.AddLogEntry("Delivering " + event.getBlocksToAccrue() + " blocks to " + player.getName(), CustomLogEntryTypes.Debug, true);
|
||||||
|
|
||||||
|
|
@ -94,6 +95,7 @@ class DeliverClaimBlocksTask implements Runnable
|
||||||
//many other operations will cause this player's data to save, including his eventual logout
|
//many other operations will cause this player's data to save, including his eventual logout
|
||||||
//dataStore.savePlayerData(player.getUniqueIdentifier(), playerData);
|
//dataStore.savePlayerData(player.getUniqueIdentifier(), playerData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GriefPrevention.AddLogEntry(player.getName() + " wasn't active enough to accrue claim blocks this round.", CustomLogEntryTypes.Debug, true);
|
GriefPrevention.AddLogEntry(player.getName() + " wasn't active enough to accrue claim blocks this round.", CustomLogEntryTypes.Debug, true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user