From 8bfdf8ecf25a9a0959b763f04473f3556b74b531 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 7 May 2021 01:18:33 +0200 Subject: [PATCH] Fix `/plot cluster sethome` triggering usage message Enhance cluster messages a bit --- .../com/plotsquared/core/command/Cluster.java | 20 ++++++++++++++----- Core/src/main/resources/lang/messages_en.json | 14 ++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Cluster.java b/Core/src/main/java/com/plotsquared/core/command/Cluster.java index 5070ce663..dde46ec8b 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Cluster.java +++ b/Core/src/main/java/com/plotsquared/core/command/Cluster.java @@ -67,7 +67,9 @@ public class Cluster extends SubCommand { // list, create, delete, resize, invite, kick, leave, helpers, tp, sethome if (args.length == 0) { // return arguments - player.sendMessage(TranslatableCaption.of("cluster.cluster_available_args")); + player.sendMessage(TranslatableCaption.of("cluster.cluster_available_args"), + Template.of("list", "list, create, delete, resize, invite, kick, leave, members, info, tp, sethome") + ); return false; } String sub = args[0].toLowerCase(); @@ -241,7 +243,10 @@ public class Cluster extends SubCommand { } } } - player.sendMessage(TranslatableCaption.of("cluster.cluster_added")); + player.sendMessage( + TranslatableCaption.of("cluster.cluster_created"), + Template.of("name", name) + ); return true; } case "disband": @@ -294,7 +299,8 @@ public class Cluster extends SubCommand { } } DBFunc.delete(cluster); - player.sendMessage(TranslatableCaption.of("cluster.cluster_deleted"), Template.of("cluster", + player.sendMessage(TranslatableCaption.of("cluster.cluster_deleted"), Template.of( + "cluster", String.valueOf(cluster) )); return true; @@ -797,7 +803,7 @@ public class Cluster extends SubCommand { } case "sh": case "setspawn": - case "sethome": + case "sethome": { if (!Permissions.hasPermission(player, Permission.PERMISSION_CLUSTER_SETHOME)) { player.sendMessage( TranslatableCaption.of("permission.no_permission"), @@ -840,8 +846,12 @@ public class Cluster extends SubCommand { relative.getX() + "," + relative.getY() + "," + relative.getZ() ); player.sendMessage(TranslatableCaption.of("position.position_set")); + return true; + } } - player.sendMessage(TranslatableCaption.of("cluster.cluster_available_args")); + player.sendMessage(TranslatableCaption.of("cluster.cluster_available_args"), + Template.of("list", "list, create, delete, resize, invite, kick, leave, members, info, tp, sethome") + ); return false; } diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 4033868b1..161a60354 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -28,16 +28,16 @@ "web.load_list": "To load a schematic, use .", "web.save_success": "Successfully saved!", "compass.compass_target": "Successfully targeted plot with your compass.", - "cluster.cluster_available_args": "The following sub commands are available: list, create, delete, resize, invite, kick, leave, members, info, tp, sethome", - "cluster.cluster_list_heading": "There are clusters in this world.", + "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", "cluster.cluster_list_element_owner": " - \n", "cluster.cluster_list_element_helpers": " - \n", "cluster.cluster_list_element_invited": " - \n", "cluster.cluster_intersection": "The proposed area overlaps with: ", "cluster.cluster_outside": "The proposed area is outside the plot area: ", - "cluster.cluster_added": "Successfully created the cluster.", - "cluster.cluster_deleted": "Successfully deleted the cluster .", + "cluster.cluster_created": "Successfully created the cluster .", + "cluster.cluster_deleted": "Successfully deleted the cluster .", "cluster.cluster_resized": "Successfully resized the cluster.", "cluster.cluster_added_user": "Successfully added user to the cluster.", "cluster.cannot_kick_player": "You cannot kick that player: ", @@ -352,11 +352,11 @@ "info.area_list_tooltip": "Claimed=\nUsage=\nClusters=\nRegion=\nGenerator=", "info.area_list_item": ">\">[] >\"> - :", "working.generating_component": "Started generating component from your settings.", - "working.clearing_done": "Plot has been cleared! Took ms.", - "working.deleting_done": "Plot has been deleted! Took ms.", + "working.clearing_done": "Plot has been cleared! Took ms.", + "working.deleting_done": "Plot has been deleted! Took ms.", "working.plot_not_claimed": "Plot not claimed.", "working.plot_is_claimed": "This plot is already claimed.", - "working.claimed": "You successfully claimed the plot .", + "working.claimed": "You successfully claimed the plot .", "working.progress": "Current progress: %", "working.component_complete": "Component generation has finished for plot .", "list.comment_list_header_paged": "(Page /) List of comment(s):",