From 3ac93dcfca7aaa960c094ed456946a5449e820a2 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 28 May 2021 20:21:41 +0200 Subject: [PATCH] Enhance `/plot target` & expiry confirm message --- .../java/com/plotsquared/core/command/CmdConfirm.java | 2 ++ Core/src/main/java/com/plotsquared/core/command/Move.java | 7 +++++-- .../main/java/com/plotsquared/core/command/Target.java | 5 ++++- Core/src/main/resources/lang/messages_en.json | 8 ++++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java b/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java index 7f5998691..0f06fe4a1 100644 --- a/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java +++ b/Core/src/main/java/com/plotsquared/core/command/CmdConfirm.java @@ -25,6 +25,7 @@ */ package com.plotsquared.core.command; +import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.caption.TranslatableCaption; import com.plotsquared.core.player.MetaDataAccess; import com.plotsquared.core.player.PlayerMetaDataKeys; @@ -59,6 +60,7 @@ public class CmdConfirm { player.sendMessage( TranslatableCaption.of("confirm.requires_confirm"), Template.of("command", commandStr), + Template.of("timeout", String.valueOf(Settings.Confirmation.CONFIRMATION_TIMEOUT_SECONDS)), Template.of("value", "/plot confirm") ); } diff --git a/Core/src/main/java/com/plotsquared/core/command/Move.java b/Core/src/main/java/com/plotsquared/core/command/Move.java index 23694db72..d7414b6a7 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Move.java +++ b/Core/src/main/java/com/plotsquared/core/command/Move.java @@ -112,8 +112,11 @@ public class Move extends SubCommand { return plot1.getPlotModificationManager().move(plot2, player, () -> { }, false).thenApply(result -> { if (result) { - player.sendMessage(TranslatableCaption.of("move.move_success"), Template.of("origin", String.valueOf(plot1)), - Template.of("target", String.valueOf(plot2))); + player.sendMessage( + TranslatableCaption.of("move.move_success"), + Template.of("origin", plot1.toString()), + Template.of("target", plot2.toString()) + ); return true; } else { player.sendMessage(TranslatableCaption.of("move.requires_unowned")); diff --git a/Core/src/main/java/com/plotsquared/core/command/Target.java b/Core/src/main/java/com/plotsquared/core/command/Target.java index dfc0cdbed..fc0f7a35a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Target.java +++ b/Core/src/main/java/com/plotsquared/core/command/Target.java @@ -81,7 +81,10 @@ public class Target extends SubCommand { return false; } target.getCenter(player::setCompassTarget); - player.sendMessage(TranslatableCaption.of("compass.compass_target")); + player.sendMessage( + TranslatableCaption.of("compass.compass_target"), + Template.of("target", target.toString()) + ); return true; } diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 298c62ac4..fbb6c45d3 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -1,7 +1,7 @@ { "confirm.expired_confirm": "Confirmation has expired, please run the command again!", "confirm.failed_confirm": "You have no pending actions to confirm!", - "confirm.requires_confirm": "Are you sure you wish to execute: ?\nThis cannot be undone! If you are sure: ", + "confirm.requires_confirm": "Are you sure you wish to execute: ?\nThis cannot be undone! If you are sure: \nThe request times out in seconds. ", "move.move_success": "Successfully moved the plot -> ", "move.move_merged": "Merged plots may not be moved. Please unmerge the plot before performing the move.", "move.copy_success": "Successfully copied plots -> ", @@ -18,7 +18,7 @@ "debug.entity_categories": "Entity categories:", "set.set_attribute": "Successfully set to .", "area.set_pos2": "You will now set pos2: . Note: The chosen plot size may result in the created area not exactly matching your second position.", - "web.generating_link": "Processing plot ...", + "web.generating_link": "Processing plot ", "web.plot_merged": "This plot is merged and therefore cannot be downloaded", "web.generating_link_failed": "Failed to generate download link for plot !", "web.generation_link_success": "Download: > \n Deletion: >\nAttention: Opening the deletion link will delete the file immediately.", @@ -27,7 +27,7 @@ "web.load_failed": "Failed to load schematic.", "web.load_list": "To load a schematic, use .", "web.save_success": "Successfully saved!", - "compass.compass_target": "Successfully targeted plot with your compass.", + "compass.compass_target": "Successfully targeted plot with your compass.", "cluster.cluster_available_args": "The following sub commands are available: ", "cluster.cluster_list_heading": "There are cluster(s) in this world.", "cluster.cluster_list_element": " - \n", @@ -107,7 +107,7 @@ "economy.cannot_afford_plot": "You cannot afford to buy this plot. It costs . You have .", "economy.not_for_sale": "This plot is not for sale.", "economy.cannot_buy_own": "You cannot buy your own plot.", - "economy.plot_sold": "Your plot; , has been sold to for .", + "economy.plot_sold": "Your plot, , has been sold to for .", "economy.cannot_afford_merge": "You cannot afford to merge the plots. It costs .", "economy.added_balance": " has been added to your balance.", "economy.removed_balance": " has been taken from your balance.",