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:
1 parent
bb6a6b3317
commit
28272032e0
1 file changed
+4
-1
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user