More json stuff, fixes and enhancements

This commit is contained in:
N0tMyFaultOG 2020-08-17 22:26:01 +02:00
parent 05a15ac689
commit d6a80c7ea5
12 changed files with 22 additions and 19 deletions

View File

@ -270,7 +270,7 @@ public class Cluster extends SubCommand {
} else { } else {
cluster = area.getCluster(player.getLocation()); cluster = area.getCluster(player.getLocation());
if (cluster == null) { if (cluster == null) {
player.sendMessage(TranslatableCaption.of("cluster.not_in_cluster")); player.sendMessage(TranslatableCaption.of("errors.not_in_cluster"));
return false; return false;
} }
} }
@ -298,7 +298,7 @@ public class Cluster extends SubCommand {
if (args.length != 3) { if (args.length != 3) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"), TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot cluster delete [name]") Template.of("value", "/plot cluster resize [name]")
); );
return false; return false;
} }
@ -623,7 +623,7 @@ public class Cluster extends SubCommand {
if (args.length != 3) { if (args.length != 3) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"), TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot cluster helpers <add | remove> <player>") Template.of("value", "/plot cluster <members | admin | helper> <add | remove> <player>")
); );
return false; return false;
} }
@ -690,7 +690,7 @@ public class Cluster extends SubCommand {
PlotCluster cluster = area.getCluster(args[1]); PlotCluster cluster = area.getCluster(args[1]);
if (cluster == null) { if (cluster == null) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("cluster.invalid_cluster"), TranslatableCaption.of("cluster.invalid_cluster_name"),
Template.of("cluster", args[1]) Template.of("cluster", args[1])
); );
return false; return false;
@ -733,7 +733,7 @@ public class Cluster extends SubCommand {
if (args.length == 2) { if (args.length == 2) {
cluster = area.getCluster(args[1]); cluster = area.getCluster(args[1]);
player.sendMessage( player.sendMessage(
TranslatableCaption.of("cluster.invalid_cluster"), TranslatableCaption.of("cluster.invalid_cluster_name"),
Template.of("cluster", args[1]) Template.of("cluster", args[1])
); );
} else { } else {

View File

@ -338,7 +338,7 @@ public class DebugExec extends SubCommand {
case "he": case "he":
case "?": case "?":
case "help": case "help":
player.sendMessage(StaticCaption.of("Possible sub commands: /plot debugexec <" + StringMan.join(allowed_params, " | ") + ">")); player.sendMessage(StaticCaption.of("<core.prefix><gold>Possible sub commands: </gray>/plot debugexec <" + StringMan.join(allowed_params, " | ") + "></gray>"));
return false; return false;
case "addcmd": case "addcmd":
try { try {

View File

@ -140,7 +140,7 @@ public class DebugRoadRegen extends SubCommand {
Plot plot = player.getCurrentPlot(); Plot plot = player.getCurrentPlot();
PlotManager manager = area.getPlotManager(); PlotManager manager = area.getPlotManager();
if (!(manager instanceof HybridPlotManager)) { if (!(manager instanceof HybridPlotManager)) {
player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world"));
return true; return true;
} }
player.sendMessage(TranslatableCaption.of("debugroadregen.schematic"), player.sendMessage(TranslatableCaption.of("debugroadregen.schematic"),

View File

@ -93,7 +93,7 @@ public class Done extends SubCommand {
return false; return false;
} }
plot.addRunning(); 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"); final Settings.Auto_Clear doneRequirements = Settings.AUTO_CLEAR.get("done");
if (ExpireManager.IMP == null || doneRequirements == null) { if (ExpireManager.IMP == null || doneRequirements == null) {
finish(plot, player, true); finish(plot, player, true);

View File

@ -234,7 +234,7 @@ public class Merge extends SubCommand {
Template.of("money", String.valueOf(price)) Template.of("money", String.valueOf(price))
); );
} }
player.sendMessage(TranslatableCaption.of("success_merge")); player.sendMessage(TranslatableCaption.of("merge.success_merge"));
return true; return true;
} }
Plot adjacent = plot.getRelative(direction); Plot adjacent = plot.getRelative(direction);

View File

@ -50,6 +50,7 @@ public class Middle extends SubCommand {
return false; return false;
} }
plot.getCenter(center -> player.teleport(center, TeleportCause.COMMAND)); plot.getCenter(center -> player.teleport(center, TeleportCause.COMMAND));
player.sendMessage(TranslatableCaption.of("teleport.teleported_to_plot"));
return true; return true;
} }
} }

View File

@ -89,7 +89,7 @@ public class RegenAllRoads extends SubCommand {
String name = args[0]; String name = args[0];
PlotManager manager = area.getPlotManager(); PlotManager manager = area.getPlotManager();
if (!(manager instanceof HybridPlotManager)) { if (!(manager instanceof HybridPlotManager)) {
player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world"));
return false; return false;
} }
//Set<BlockVector2> chunks = ChunkManager.manager.getChunkChunks(name); //Set<BlockVector2> chunks = ChunkManager.manager.getChunkChunks(name);

View File

@ -34,7 +34,7 @@ import com.plotsquared.core.util.query.PlotQuery;
import net.kyori.adventure.text.minimessage.Template; import net.kyori.adventure.text.minimessage.Template;
@CommandDeclaration(command = "target", @CommandDeclaration(command = "target",
usage = "/plot target <<plot> | nearest>", usage = "/plot target <<X;Z> | nearest>",
description = "Target a plot with your compass", description = "Target a plot with your compass",
permission = "plots.target", permission = "plots.target",
requiredType = RequiredType.PLAYER, requiredType = RequiredType.PLAYER,
@ -54,7 +54,7 @@ public class Target extends SubCommand {
if (args.length == 0) { if (args.length == 0) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"), TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot target <<plot> | nearest>") Template.of("value", "/plot target <<X;Z> | nearest>")
); );
return false; return false;
} }

View File

@ -239,7 +239,8 @@ public class Template extends SubCommand {
} }
final PlotArea area = this.plotAreaManager.getPlotAreaByString(world); final PlotArea area = this.plotAreaManager.getPlotAreaByString(world);
if (area == null) { 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; return false;
} }
final PlotManager manager = area.getPlotManager(); final PlotManager manager = area.getPlotManager();

View File

@ -372,7 +372,7 @@ public class Plot {
} }
if (area == null) { if (area == null) {
if (message) { if (message) {
player.sendMessage(TranslatableCaption.of("errors.not_valid_plot_world")); player.sendMessage(TranslatableCaption.of("errors.invalid_plot_world"));
} }
return null; return null;
} }

View File

@ -1,7 +1,7 @@
{ {
"confirm.expired_confirm": "<prefix><red>Confirmation has expired, please run the command again!</red>", "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.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></orange><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>",
"move.move_success": "<prefix><dark_aqua>Successfully moved plot.</dark_aqua>", "move.move_success": "<prefix><dark_aqua>Successfully moved plot.</dark_aqua>",
"move.move_merged": "<prefix><red>Merged plots may not be moved. Please unmerge the plot before performing the move.</red>", "move.move_merged": "<prefix><red>Merged plots may not be moved. Please unmerge the plot before performing the move.</red>",
@ -9,7 +9,7 @@
"move.requires_unowned": "<prefix><red>The location specified is already occupied.</red>", "move.requires_unowned": "<prefix><red>The location specified is already occupied.</red>",
"debug.requires_unmerged": "<prefix><red>The plot cannot be merged.</red>", "debug.requires_unmerged": "<prefix><red>The plot cannot be merged.</red>",
"debug.debug_header": "<prefix> <gold>Debug Information</orange>\n", "debug.debug_header": "<prefix> <gold>Debug Information</gold>\n",
"debug.debug_section": "<gray>>></gray> <gold><bold>&l<val></bold></gold>", "debug.debug_section": "<gray>>></gray> <gold><bold>&l<val></bold></gold>",
"debug.debug_line": "<gray>>></gray> <gold><var></gold><gray>:</gray><gold> <val></gold>\n", "debug.debug_line": "<gray>>></gray> <gold><var></gold><gray>:</gray><gold> <val></gold>\n",
"debug.plot_debug": "<gray>[<gold>Plot </gold><gray>Debug] (</gray><gold><plot></gold><gray>): <message></gray>", "debug.plot_debug": "<gray>[<gold>Plot </gold><gray>Debug] (</gray><gold><plot></gold><gray>): <message></gray>",
@ -311,7 +311,8 @@
"errors.not_in_plot_world": "<prefix><red>You're not in a plot area.</red>", "errors.not_in_plot_world": "<prefix><red>You're not in a plot area.</red>",
"errors.plotworld_incompatible": "<prefix><red>The two worlds must be compatible.</red>", "errors.plotworld_incompatible": "<prefix><red>The two worlds must be compatible.</red>",
"errors.not_valid_world": "<prefix><red>That is not a valid world (case sensitive).</red>", "errors.not_valid_world": "<prefix><red>That is not a valid world (case sensitive).</red>",
"errors.not_valid_plot_world": "<prefix><red><value> is not a valid plot area (case sensitive).</red>", "errors.not_valid_plot_world": "<prefix><gray><value></gray><red> is not a valid plot area (case sensitive).</red>",
"errors.invalid_plot_world": "<prefix><redThat is not a valid plot area (case sensitive).</red>",
"errors.no_plots": "<prefix><gray>You don't have any plots.</gray>", "errors.no_plots": "<prefix><gray>You don't have any plots.</gray>",
"errors.player_no_plots": "<prefix><gray>That player does not own any plots.</gray>", "errors.player_no_plots": "<prefix><gray>That player does not own any plots.</gray>",
"errors.wait_for_timer": "<prefix><gray>A set block timer is bound to either the current plot or you. Please wait for it to finish.</gray>", "errors.wait_for_timer": "<prefix><gray>A set block timer is bound to either the current plot or you. Please wait for it to finish.</gray>",