From c6a368d6f208f0777796b798177223c9f4edbf53 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 17 Aug 2020 13:24:15 +0200 Subject: [PATCH] More json fixes --- .../main/java/com/plotsquared/core/command/Download.java | 6 ++++-- .../src/main/java/com/plotsquared/core/command/Grant.java | 1 + Core/src/main/java/com/plotsquared/core/command/Info.java | 2 +- .../src/main/java/com/plotsquared/core/command/Music.java | 8 ++++---- .../core/components/ComponentPresetManager.java | 2 +- Core/src/main/resources/lang/messages_en.json | 3 ++- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Download.java b/Core/src/main/java/com/plotsquared/core/command/Download.java index 9b35dce19..9d7c88b94 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Download.java +++ b/Core/src/main/java/com/plotsquared/core/command/Download.java @@ -45,7 +45,7 @@ import net.kyori.adventure.text.minimessage.Template; import javax.annotation.Nonnull; import java.net.URL; -@CommandDeclaration(usage = "/plot download [schematic|world]", +@CommandDeclaration(usage = "/plot download [schematic | world]", command = "download", aliases = {"dl"}, category = CommandCategory.SCHEMATIC, @@ -111,7 +111,9 @@ public class Download extends SubCommand { player.sendMessage(TranslatableCaption.of("web.generating_link_failed")); return; } - player.sendMessage(StaticCaption.of(url.toString()) + player.sendMessage( + TranslatableCaption.of("web.generation_link_success"), + Template.of("url", url.toString()) ); } }); diff --git a/Core/src/main/java/com/plotsquared/core/command/Grant.java b/Core/src/main/java/com/plotsquared/core/command/Grant.java index 75a8f5a3c..f1a970b89 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Grant.java +++ b/Core/src/main/java/com/plotsquared/core/command/Grant.java @@ -49,6 +49,7 @@ import java.util.concurrent.TimeoutException; category = CommandCategory.CLAIMING, usage = "/plot grant [player]", permission = "plots.grant", + description = "Manage plot grants.", requiredType = RequiredType.NONE) public class Grant extends Command { diff --git a/Core/src/main/java/com/plotsquared/core/command/Info.java b/Core/src/main/java/com/plotsquared/core/command/Info.java index a1724201c..8304c8f0a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Info.java +++ b/Core/src/main/java/com/plotsquared/core/command/Info.java @@ -39,7 +39,7 @@ import net.kyori.adventure.text.minimessage.Template; @CommandDeclaration(command = "info", aliases = "i", description = "Display plot info", - usage = "/plot info [-f, to force info]", + usage = "/plot info [-f to force info]", category = CommandCategory.INFO) public class Info extends SubCommand { diff --git a/Core/src/main/java/com/plotsquared/core/command/Music.java b/Core/src/main/java/com/plotsquared/core/command/Music.java index f9404069d..5b2c27b0d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Music.java +++ b/Core/src/main/java/com/plotsquared/core/command/Music.java @@ -115,16 +115,16 @@ public class Music extends SubCommand { int index = 0; for (final String disc : DISCS) { - final String name = String.format("%s", disc); - final String[] lore = {"Click to play!"}; + final String name = String.format("%s", disc); + final String[] lore = {"Click to play!"}; final PlotItemStack item = new PlotItemStack(disc, 1, name, lore); inv.setItem(index++, item); } // Always add the cancel button // if (player.getMeta("music") != null) { - String name = "Cancel music"; - String[] lore = {"Click to cancel!"}; + String name = "Cancel music"; + String[] lore = {"Click to cancel!"}; inv.setItem(index, new PlotItemStack("bedrock", 1, name, lore)); // } diff --git a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java index c4b991af1..550142225 100644 --- a/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java +++ b/Core/src/main/java/com/plotsquared/core/components/ComponentPresetManager.java @@ -110,7 +110,7 @@ public class ComponentPresetManager { } else { final List defaultPreset = Collections.singletonList( new ComponentPreset(ClassicPlotManagerComponent.FLOOR, "##wool", 0, "", "&6D&ai&cs&ec&bo &2F&3l&do&9o&4r", - Arrays.asList("&6Spice up your plot floor"), ItemTypes.YELLOW_WOOL)); + Arrays.asList("Spice up your plot floor"), ItemTypes.YELLOW_WOOL)); yamlConfiguration.set("presets", defaultPreset.stream().map(ComponentPreset::serialize).collect(Collectors.toList())); try { yamlConfiguration.save(file); diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index 5f71ff5b2..cfbae26d0 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -25,6 +25,7 @@ "web.generating_link": "Processing plot...", "web.generating_link_failed": "Failed to generate download link!", + "web.generation_link_success": ">", "web.save_failed": "Failed to save.", "web.load_null": "Please use to get a list of schematics.", "web.load_failed": "Failed to load schematic.", @@ -441,7 +442,7 @@ "signs.owner_sign_line_4": "Claimed", "help.help_header": "--------- PlotSquared Help ---------", - "help.help_page_header": "Category: , Page: /", + "help.help_page_header": "\nCategory: , Page: /\n", "help.help_footer": "--------- PlotSquared Help ---------", "help.help_info_item": "/plot help - ", "help.help_item": " []\n - \n",