fix trustlist being reset on server stop

This commit is contained in:
EtienneDx 2019-04-30 18:35:10 +02:00
parent f603b07ff7
commit c0f616db56
4 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>Me.EtienneDx</groupId>
<artifactId>RealEstate</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.1.2-SNAPSHOT</version>
<name>RealEstate</name>
<description>A spigot plugin for selling, renting and leasing GriefPrevention claims</description>
<build>

View File

@ -203,6 +203,7 @@ public class RECommand extends BaseCommand
}
bt.exitOffer = null;
claim.dropPermission(bt.buyer.toString());
GriefPrevention.instance.dataStore.saveClaim(claim);
bt.buyer = null;
bt.update();// eventual cancel is contained in here
}

View File

@ -297,6 +297,7 @@ public class ClaimLease extends BoughtTransaction
lastPayment = LocalDateTime.now();
paymentsLeft--;
claim.setPermission(buyer.toString(), ClaimPermission.Build);
GriefPrevention.instance.dataStore.saveClaim(claim);
getHolder().breakNaturally();// leases don't have signs indicating the remaining time
update();
RealEstate.transactionsStore.saveData();
@ -334,8 +335,6 @@ public class ClaimLease extends BoughtTransaction
player.sendMessage(RealEstate.instance.config.chatPrefix + ChatColor.AQUA + "You have successfully paid lease for this " + claimType +
" for " + ChatColor.GREEN + price + " " + RealEstate.econ.currencyNamePlural() + ChatColor.AQUA + ", " +
ChatColor.GREEN + paymentsLeft + ChatColor.AQUA + " payments left");
destroySign();
}
}

View File

@ -117,6 +117,7 @@ public class ClaimRent extends BoughtTransaction
{
Claim claim = GriefPrevention.instance.dataStore.getClaimAt(sign, false, null);
claim.dropPermission(buyer.toString());
GriefPrevention.instance.dataStore.saveClaim(claim);
if(msgBuyer && Bukkit.getOfflinePlayer(buyer).isOnline() && RealEstate.instance.config.cfgMessageBuyer)
{
Bukkit.getPlayer(buyer).sendMessage(RealEstate.instance.config.chatPrefix + ChatColor.AQUA +
@ -274,6 +275,7 @@ public class ClaimRent extends BoughtTransaction
startDate = LocalDateTime.now();
autoRenew = false;
claim.setPermission(buyer.toString(), ClaimPermission.Build);
GriefPrevention.instance.dataStore.saveClaim(claim);
update();
RealEstate.transactionsStore.saveData();