BuyRegion/RentRegion: fix %player% placeholders for selling/unrenting confirmation messages

This commit is contained in:
Thijs Wiefferink 2019-06-16 21:40:58 +02:00
parent 41ced9ee6c
commit fe131dc157
2 changed files with 6 additions and 5 deletions

View File

@ -526,14 +526,15 @@ public class BuyRegion extends GeneralRegion {
// Handle schematic save/restore (while %uuid% is still available)
handleSchematicEvent(RegionEvent.SOLD);
// Send message: before actual removal of the buyer so that it is still available for variables
message(executor, "sell-sold");
// Remove friends and the owner
getFriendsFeature().clearFriends();
UUID oldBuyer = getBuyer();
setBuyer(null);
removeLastActiveTime();
message(executor, "sell-sold");
// Notify about updates
this.notifyAndUpdate(new SoldRegionEvent(this, oldBuyer, Math.max(moneyBack, 0)));
return true;

View File

@ -694,6 +694,9 @@ public class RentRegion extends GeneralRegion {
// Handle schematic save/restore (while %uuid% is still available)
handleSchematicEvent(RegionEvent.UNRENTED);
// Send message: before actual removal of the renter so that it is still available for variables
message(executor, "unrent-unrented");
// Remove friends, the owner and renteduntil values
getFriendsFeature().clearFriends();
UUID oldRenter = getRenter();
@ -702,9 +705,6 @@ public class RentRegion extends GeneralRegion {
setTimesExtended(-1);
removeLastActiveTime();
// Send messages
message(executor, "unrent-unrented");
// Notify about updates
this.notifyAndUpdate(new UnrentedRegionEvent(this, oldRenter, Math.max(0, moneyBack)));
return true;