Enhance /plot target & expiry confirm message

This commit is contained in:
NotMyFault 2021-05-28 20:21:41 +02:00
parent c509882a18
commit 3ac93dcfca
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
4 changed files with 15 additions and 7 deletions

View File

@ -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")
);
}

View File

@ -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"));

View File

@ -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;
}

View File

@ -1,7 +1,7 @@
{
"confirm.expired_confirm": "<prefix><red>Confirmation has expired, please run the command again!</red>",
"confirm.failed_confirm": "<prefix><red>You have no pending actions to confirm!</red>",
"confirm.requires_confirm": "<prefix><gray>Are you sure you wish to execute: </gray><gold><command></gold><gray>?</gray>\n<red>This cannot be undone! If you are sure: </red><gray><value></gray>",
"confirm.requires_confirm": "<prefix><gray>Are you sure you wish to execute: </gray><gold><command></gold><gray>?</gray>\n<red>This cannot be undone! If you are sure: </red><gray><value></gray>\n<gray>The request times out in <red><timeout></red><gray> seconds. ",
"move.move_success": "<prefix><dark_aqua>Successfully moved the plot</dark_aqua> <gold><origin></gold><dark_aqua> -> </dark_aqua><gold><target></gold>",
"move.move_merged": "<prefix><red>Merged plots may not be moved. Please unmerge the plot before performing the move.</red>",
"move.copy_success": "<prefix><dark_aqua>Successfully copied plots</dark_aqua> <gold><origin></gold><dark_aqua> -> </dark_aqua><gold><target></gold>",
@ -18,7 +18,7 @@
"debug.entity_categories": "<prefix><red>Entity categories:</red>",
"set.set_attribute": "<prefix><dark_aqua>Successfully set <attribute> to <value>.</dark_aqua>",
"area.set_pos2": "You will now set pos2: <command>. Note: The chosen plot size may result in the created area not exactly matching your second position.",
"web.generating_link": "<prefix><gold>Processing plot <plot>...</gold>",
"web.generating_link": "<prefix><dark_aqua>Processing plot </dark_aqua><gold><plot></gold>",
"web.plot_merged": "<prefix><red>This plot is merged and therefore cannot be downloaded</red>",
"web.generating_link_failed": "<prefix><red>Failed to generate download link for plot <plot>!</red>",
"web.generation_link_success": "<prefix><gold>Download: <gray><click:open_url:<download>><download></click></gray> \n Deletion: <gray><click:open_url:<delete>><delete></click></gray>\n<red>Attention: Opening the deletion link will delete the file immediately.</red></gold>",
@ -27,7 +27,7 @@
"web.load_failed": "<prefix><red>Failed to load schematic.</red>",
"web.load_list": "<prefix><gray>To load a schematic, use </gray><gold><command></gold><gray>.</gray>",
"web.save_success": "<prefix><gold>Successfully saved!</gold>",
"compass.compass_target": "<prefix><dark_aqua>Successfully targeted plot with your compass.</dark_aqua>",
"compass.compass_target": "<prefix><dark_aqua>Successfully targeted plot </dark_aqua><gold><target></gold><dark_aqua> with your compass.</dark_aqua>",
"cluster.cluster_available_args": "<prefix><gold>The following sub commands are available: </gold><list>",
"cluster.cluster_list_heading": "<prefix><gray>There are </gray><gold><amount></gold><gray> cluster(s) in this world.</gray>",
"cluster.cluster_list_element": "<prefix><gray> - </gray><gold><cluster></gold>\n",
@ -107,7 +107,7 @@
"economy.cannot_afford_plot": "<prefix><red>You cannot afford to buy this plot. It costs <gold><money></gold>. You have <gold><balance></gold>.</red>",
"economy.not_for_sale": "<prefix><red>This plot is not for sale.</red>",
"economy.cannot_buy_own": "<prefix><red>You cannot buy your own plot.</red>",
"economy.plot_sold": "<prefix><dark_aqua>Your plot; <gold><plot></gold>, has been sold to <gold><player></gold> for <gold><price></gold>.</dark_aqua>",
"economy.plot_sold": "<prefix><dark_aqua>Your plot, <gold><plot></gold>, has been sold to <gold><player></gold> for <gold><price></gold>.</dark_aqua>",
"economy.cannot_afford_merge": "<prefix><red>You cannot afford to merge the plots. It costs <gold><money></gold>.</red>",
"economy.added_balance": "<prefix><gold><money> </gold><gray>has been added to your balance.</gray>",
"economy.removed_balance": "<prefix><gold><money> </gold><gray>has been taken from your balance.</gray>",