Skip to content

Commit

Permalink
fix trustlist being reset on server stop
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneDx committed Apr 30, 2019
1 parent f603b07 commit c0f616d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/me/EtienneDx/RealEstate/RECommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ else if(RealEstate.instance.config.cfgMailOffline && RealEstate.ess != null)
}
bt.exitOffer = null;
claim.dropPermission(bt.buyer.toString());
GriefPrevention.instance.dataStore.saveClaim(claim);
bt.buyer = null;
bt.update();// eventual cancel is contained in here
}
Expand Down
3 changes: 1 addition & 2 deletions src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ public void interact(Player player)
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();
Expand Down Expand Up @@ -334,8 +335,6 @@ else if(RealEstate.instance.config.cfgMailOffline && RealEstate.ess != null)
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();
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private void unRent(boolean msgBuyer)
{
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 +
Expand Down Expand Up @@ -274,6 +275,7 @@ public void interact(Player player)
startDate = LocalDateTime.now();
autoRenew = false;
claim.setPermission(buyer.toString(), ClaimPermission.Build);
GriefPrevention.instance.dataStore.saveClaim(claim);
update();
RealEstate.transactionsStore.saveData();

Expand Down

0 comments on commit c0f616d

Please sign in to comment.