Tweaked message for resizing others' claims.
Now shows OWNER's claim blocks remaining, or zero for admin claims.
This commit is contained in:
parent
6f428fc1df
commit
6e6b0d3ee6
|
|
@ -1144,7 +1144,7 @@ public abstract class DataStore
|
|||
this.addDefault(defaults, Messages.NoCreateClaimPermission, "You don't have permission to claim land.", null);
|
||||
this.addDefault(defaults, Messages.ResizeClaimTooSmall, "This new size would be too small. Claims must be at least {0} x {0}.", "0: minimum claim size");
|
||||
this.addDefault(defaults, Messages.ResizeNeedMoreBlocks, "You don't have enough blocks for this size. You need {0} more.", "0: how many needed");
|
||||
this.addDefault(defaults, Messages.ClaimResizeSuccess, "Claim resized. You now have {0} available claim blocks.", "0: remaining blocks");
|
||||
this.addDefault(defaults, Messages.ClaimResizeSuccess, "Claim resized. {0} available claim blocks remaining.", "0: remaining blocks");
|
||||
this.addDefault(defaults, Messages.ResizeFailOverlap, "Can't resize here because it would overlap another nearby claim.", null);
|
||||
this.addDefault(defaults, Messages.ResizeStart, "Resizing claim. Use your shovel again at the new location for this corner.", null);
|
||||
this.addDefault(defaults, Messages.ResizeFailOverlapSubdivision, "You can't create a subdivision here because it would overlap another subdivision. Consider /abandonclaim to delete it, or use your shovel at a corner to resize it.", null);
|
||||
|
|
|
|||
|
|
@ -1897,8 +1897,29 @@ class PlayerEventHandler implements Listener
|
|||
|
||||
if(result.succeeded)
|
||||
{
|
||||
//inform and show the player
|
||||
GriefPrevention.sendMessage(player, TextMode.Success, Messages.ClaimResizeSuccess, String.valueOf(playerData.getRemainingClaimBlocks()));
|
||||
//decide how many claim blocks are available for more resizing
|
||||
int claimBlocksRemaining = 0;
|
||||
if(!playerData.claimResizing.isAdminClaim())
|
||||
{
|
||||
if(playerData.claimResizing.ownerID == player.getUniqueId())
|
||||
{
|
||||
claimBlocksRemaining = playerData.getRemainingClaimBlocks();
|
||||
}
|
||||
else
|
||||
{
|
||||
UUID ownerID = playerData.claimResizing.ownerID;
|
||||
PlayerData ownerData = this.dataStore.getPlayerData(ownerID);
|
||||
claimBlocksRemaining = ownerData.getRemainingClaimBlocks();
|
||||
OfflinePlayer owner = GriefPrevention.instance.getServer().getOfflinePlayer(ownerID);
|
||||
if(!owner.isOnline())
|
||||
{
|
||||
this.dataStore.clearCachedPlayerData(ownerID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//inform about success, visualize, communicate remaining blocks available
|
||||
GriefPrevention.sendMessage(player, TextMode.Success, Messages.ClaimResizeSuccess, String.valueOf(claimBlocksRemaining));
|
||||
Visualization visualization = Visualization.FromClaim(result.claim, clickedBlock.getY(), VisualizationType.Claim, player.getLocation());
|
||||
Visualization.Apply(player, visualization);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user