Fixed players charged blocks twice for same claim.

Side effect: likely faster plugin boot due to reduced number of reads
and writes.
This commit is contained in:
ryanhamshire 2014-10-07 19:28:56 -07:00
parent bb6a6b3317
commit 28272032e0

View File

@ -205,7 +205,10 @@ public abstract class DataStore
{ {
newClaim.parent.children.add(newClaim); newClaim.parent.children.add(newClaim);
newClaim.inDataStore = true; newClaim.inDataStore = true;
if(writeToStorage)
{
this.saveClaim(newClaim); this.saveClaim(newClaim);
}
return; return;
} }
@ -228,7 +231,7 @@ public abstract class DataStore
newClaim.inDataStore = true; newClaim.inDataStore = true;
//except for administrative claims (which have no owner), update the owner's playerData with the new claim //except for administrative claims (which have no owner), update the owner's playerData with the new claim
if(!newClaim.isAdminClaim()) if(!newClaim.isAdminClaim() && writeToStorage)
{ {
PlayerData ownerData = this.getPlayerData(newClaim.ownerID); PlayerData ownerData = this.getPlayerData(newClaim.ownerID);
ownerData.claims.add(newClaim); ownerData.claims.add(newClaim);