From d6a80c7ea58ebaea3cddd921308cdcac1a73997e Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 17 Aug 2020 22:26:01 +0200 Subject: [PATCH] More json stuff, fixes and enhancements --- .../java/com/plotsquared/core/command/Cluster.java | 10 +++++----- .../java/com/plotsquared/core/command/DebugExec.java | 2 +- .../com/plotsquared/core/command/DebugRoadRegen.java | 2 +- .../main/java/com/plotsquared/core/command/Done.java | 2 +- .../main/java/com/plotsquared/core/command/Merge.java | 2 +- .../main/java/com/plotsquared/core/command/Middle.java | 1 + .../main/java/com/plotsquared/core/command/Purge.java | 2 +- .../com/plotsquared/core/command/RegenAllRoads.java | 2 +- .../main/java/com/plotsquared/core/command/Target.java | 4 ++-- .../java/com/plotsquared/core/command/Template.java | 3 ++- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 2 +- Core/src/main/resources/lang/messages_en.json | 9 +++++---- 12 files changed, 22 insertions(+), 19 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 fecca3854..6359ed1a9 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Cluster.java +++ b/Core/src/main/java/com/plotsquared/core/command/Cluster.java @@ -270,7 +270,7 @@ public class Cluster extends SubCommand { } else { cluster = area.getCluster(player.getLocation()); if (cluster == null) { - player.sendMessage(TranslatableCaption.of("cluster.not_in_cluster")); + player.sendMessage(TranslatableCaption.of("errors.not_in_cluster")); return false; } } @@ -298,7 +298,7 @@ public class Cluster extends SubCommand { if (args.length != 3) { player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "/plot cluster delete [name]") + Template.of("value", "/plot cluster resize [name]") ); return false; } @@ -623,7 +623,7 @@ public class Cluster extends SubCommand { if (args.length != 3) { player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "/plot cluster helpers ") + Template.of("value", "/plot cluster ") ); return false; } @@ -690,7 +690,7 @@ public class Cluster extends SubCommand { PlotCluster cluster = area.getCluster(args[1]); if (cluster == null) { player.sendMessage( - TranslatableCaption.of("cluster.invalid_cluster"), + TranslatableCaption.of("cluster.invalid_cluster_name"), Template.of("cluster", args[1]) ); return false; @@ -733,7 +733,7 @@ public class Cluster extends SubCommand { if (args.length == 2) { cluster = area.getCluster(args[1]); player.sendMessage( - TranslatableCaption.of("cluster.invalid_cluster"), + TranslatableCaption.of("cluster.invalid_cluster_name"), Template.of("cluster", args[1]) ); } else { diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java index 9920d3fab..a936b40a1 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java @@ -338,7 +338,7 @@ public class DebugExec extends SubCommand { case "he": case "?": case "help": - player.sendMessage(StaticCaption.of("Possible sub commands: /plot debugexec <" + StringMan.join(allowed_params, " | ") + ">")); + player.sendMessage(StaticCaption.of("Possible sub commands: /plot debugexec <" + StringMan.join(allowed_params, " | ") + ">")); return false; case "addcmd": try { diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java index f9027678e..9f357794d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugRoadRegen.java @@ -140,7 +140,7 @@ public class DebugRoadRegen extends SubCommand { Plot plot = player.getCurrentPlot(); PlotManager manager = area.getPlotManager(); if (!(manager instanceof HybridPlotManager)) { - player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); + player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world")); return true; } player.sendMessage(TranslatableCaption.of("debugroadregen.schematic"), diff --git a/Core/src/main/java/com/plotsquared/core/command/Done.java b/Core/src/main/java/com/plotsquared/core/command/Done.java index 518f5bbf1..64e9161d5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Done.java +++ b/Core/src/main/java/com/plotsquared/core/command/Done.java @@ -93,7 +93,7 @@ public class Done extends SubCommand { return false; } plot.addRunning(); - player.sendMessage(TranslatableCaption.of("web.generating_lin")); + player.sendMessage(TranslatableCaption.of("web.generating_link")); final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done"); if (ExpireManager.IMP == null || doneRequirements == null) { finish(plot, player, true); diff --git a/Core/src/main/java/com/plotsquared/core/command/Merge.java b/Core/src/main/java/com/plotsquared/core/command/Merge.java index 1ccccd970..925053c60 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Merge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Merge.java @@ -234,7 +234,7 @@ public class Merge extends SubCommand { Template.of("money", String.valueOf(price)) ); } - player.sendMessage(TranslatableCaption.of("success_merge")); + player.sendMessage(TranslatableCaption.of("merge.success_merge")); return true; } Plot adjacent = plot.getRelative(direction); diff --git a/Core/src/main/java/com/plotsquared/core/command/Middle.java b/Core/src/main/java/com/plotsquared/core/command/Middle.java index 0bc2a16fe..45ed32038 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Middle.java +++ b/Core/src/main/java/com/plotsquared/core/command/Middle.java @@ -50,6 +50,7 @@ public class Middle extends SubCommand { return false; } plot.getCenter(center -> player.teleport(center, TeleportCause.COMMAND)); + player.sendMessage(TranslatableCaption.of("teleport.teleported_to_plot")); return true; } } diff --git a/Core/src/main/java/com/plotsquared/core/command/Purge.java b/Core/src/main/java/com/plotsquared/core/command/Purge.java index 209e7c0b3..cbebb1ce5 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Purge.java +++ b/Core/src/main/java/com/plotsquared/core/command/Purge.java @@ -51,7 +51,7 @@ import java.util.Map.Entry; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -@CommandDeclaration(usage = "/plot purge world: area: id: owner: shared: unknown:[true|false] clear:[true|false]", +@CommandDeclaration(usage = "/plot purge world: area: id: owner: shared: unknown:[true | false] clear:[true | false]", command = "purge", permission = "plots.admin", description = "Purge all plots for a world", diff --git a/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java b/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java index 4b68cf617..ac2940fb9 100644 --- a/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java +++ b/Core/src/main/java/com/plotsquared/core/command/RegenAllRoads.java @@ -89,7 +89,7 @@ public class RegenAllRoads extends SubCommand { String name = args[0]; PlotManager manager = area.getPlotManager(); if (!(manager instanceof HybridPlotManager)) { - player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); + player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world")); return false; } //Set chunks = ChunkManager.manager.getChunkChunks(name); 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 2c35e6672..c49a7237c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Target.java +++ b/Core/src/main/java/com/plotsquared/core/command/Target.java @@ -34,7 +34,7 @@ import com.plotsquared.core.util.query.PlotQuery; import net.kyori.adventure.text.minimessage.Template; @CommandDeclaration(command = "target", - usage = "/plot target < | nearest>", + usage = "/plot target < | nearest>", description = "Target a plot with your compass", permission = "plots.target", requiredType = RequiredType.PLAYER, @@ -54,7 +54,7 @@ public class Target extends SubCommand { if (args.length == 0) { player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "/plot target < | nearest>") + Template.of("value", "/plot target < | nearest>") ); return false; } diff --git a/Core/src/main/java/com/plotsquared/core/command/Template.java b/Core/src/main/java/com/plotsquared/core/command/Template.java index 02cad7d7d..de7942293 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Template.java +++ b/Core/src/main/java/com/plotsquared/core/command/Template.java @@ -239,7 +239,8 @@ public class Template extends SubCommand { } final PlotArea area = this.plotAreaManager.getPlotAreaByString(world); if (area == null) { - player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); + player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world"), + net.kyori.adventure.text.minimessage.Template.of("value", args[1])); return false; } final PlotManager manager = area.getPlotManager(); diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 7c4621414..2a89f4fad 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -372,7 +372,7 @@ public class Plot { } if (area == null) { if (message) { - player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); + player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world")); } return null; } diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 83e470293..7d925dc7f 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: ", "move.move_success": "Successfully moved plot.", "move.move_merged": "Merged plots may not be moved. Please unmerge the plot before performing the move.", @@ -9,7 +9,7 @@ "move.requires_unowned": "The location specified is already occupied.", "debug.requires_unmerged": "The plot cannot be merged.", - "debug.debug_header": " Debug Information\n", + "debug.debug_header": " Debug Information\n", "debug.debug_section": ">> &l", "debug.debug_line": ">> : \n", "debug.plot_debug": "[Plot Debug] (): ", @@ -58,7 +58,7 @@ "cluster.cluster_regenerated": "Successfully started cluster regeneration.", "cluster.cluster_teleporting": "Teleporting...", "cluster.cluster_info": "Current cluster: \nName: \nOwner: \nSize: \nRights: ", - + "border.border": "You are outside the current map border.", "worldedit.worldedit_bypass": "To bypass your restrictions use ", @@ -311,7 +311,8 @@ "errors.not_in_plot_world": "You're not in a plot area.", "errors.plotworld_incompatible": "The two worlds must be compatible.", "errors.not_valid_world": "That is not a valid world (case sensitive).", - "errors.not_valid_plot_world": " is not a valid plot area (case sensitive).", + "errors.not_valid_plot_world": " is not a valid plot area (case sensitive).", + "errors.invalid_plot_world": "", "errors.no_plots": "You don't have any plots.", "errors.player_no_plots": "That player does not own any plots.", "errors.wait_for_timer": "A set block timer is bound to either the current plot or you. Please wait for it to finish.",