From c0f616db56b087d1e383a6fcfa5d58e335d35c76 Mon Sep 17 00:00:00 2001 From: EtienneDx Date: Tue, 30 Apr 2019 18:35:10 +0200 Subject: [PATCH] fix trustlist being reset on server stop --- pom.xml | 2 +- src/me/EtienneDx/RealEstate/RECommand.java | 1 + src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java | 3 +-- src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 48eaa0b..5f72a01 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 Me.EtienneDx RealEstate - 0.1.1-SNAPSHOT + 0.1.2-SNAPSHOT RealEstate A spigot plugin for selling, renting and leasing GriefPrevention claims diff --git a/src/me/EtienneDx/RealEstate/RECommand.java b/src/me/EtienneDx/RealEstate/RECommand.java index 3aa3d52..229fa1c 100644 --- a/src/me/EtienneDx/RealEstate/RECommand.java +++ b/src/me/EtienneDx/RealEstate/RECommand.java @@ -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 } diff --git a/src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java b/src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java index c8c3195..df375ac 100644 --- a/src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java +++ b/src/me/EtienneDx/RealEstate/Transactions/ClaimLease.java @@ -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(); @@ -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(); } } diff --git a/src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java b/src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java index 5eab8c9..9ed289f 100644 --- a/src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java +++ b/src/me/EtienneDx/RealEstate/Transactions/ClaimRent.java @@ -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 + @@ -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();