Skip to content

Commit

Permalink
Merge pull request #134 from TownyAdvanced/fix/help_messages
Browse files Browse the repository at this point in the history
Fix help messages not translating the colour codes used in them.
  • Loading branch information
LlmDl authored Nov 12, 2023
2 parents f8e4704 + cc40a07 commit 38883c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.townyadvanced</groupId>
<artifactId>TownyResources</artifactId>
<version>0.6.2</version>
<version>0.6.3</version>
<name>townyresources</name> <!-- Leave lower-cased -->

<properties>
Expand Down Expand Up @@ -44,13 +44,13 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
<artifactId>Towny</artifactId>
<version>0.99.0.6</version>
<version>0.99.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.TownyCommandAddonAPI;
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownyCommandAddonAPI.CommandType;
import com.palmergames.bukkit.towny.command.BaseCommand;
import com.palmergames.bukkit.towny.exceptions.TownyException;
Expand Down Expand Up @@ -38,8 +39,8 @@ public List<String> onTabComplete(CommandSender sender, Command command, String

private void showTownyResourcesHelp(CommandSender sender) {
Translator translator = Translator.locale(sender);
sender.sendMessage(ChatTools.formatTitle("/nation collectresources"));
sender.sendMessage(ChatTools.formatCommand("Eg", "/nation", "collectresources", translator.of("townyresources.help_nationcollect")));
TownyMessaging.sendMessage(sender, ChatTools.formatTitle("/nation collectresources"));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/nation", "collectresources", translator.of("townyresources.help_nationcollect")));
}

public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.TownyCommandAddonAPI;
import com.palmergames.bukkit.towny.TownyEconomyHandler;
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.TownyCommandAddonAPI.CommandType;
import com.palmergames.bukkit.towny.command.BaseCommand;
Expand Down Expand Up @@ -51,9 +52,9 @@ public List<String> onTabComplete(CommandSender sender, Command command, String

private void showTownResourcesHelp(CommandSender sender) {
Translator translator = Translator.locale(sender);
sender.sendMessage(ChatTools.formatTitle("/town resources"));
sender.sendMessage(ChatTools.formatCommand("Eg", "/t resources", "survey", translator.of("townyresources.help_survey")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/t resources", "collect", translator.of("townyresources.help_towncollect")));
TownyMessaging.sendMessage(sender, ChatTools.formatTitle("/town resources"));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/t resources", "survey", translator.of("townyresources.help_survey")));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/t resources", "collect", translator.of("townyresources.help_towncollect")));
}

public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ private void parseAdminCommand(CommandSender sender, String[] args) {

private void showHelp(CommandSender sender) {
Translator translator = Translator.locale(sender);
sender.sendMessage(ChatTools.formatTitle("/townyadmin resources"));
sender.sendMessage(ChatTools.formatCommand("Eg", "/ta resources", "reload", translator.of("townyresources.admin_help_reload")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/ta resources", "reroll_all_resources", translator.of("townyresources.admin_help_reroll")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/ta resources", "reroll_all_resources [townname]", translator.of("townyresources.admin_help_reroll_one_town")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/ta resources", "bypass", translator.of("townyresources.admin_help_bypass")));
TownyMessaging.sendMessage(sender, ChatTools.formatTitle("/townyadmin resources"));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/ta resources", "reload", translator.of("townyresources.admin_help_reload")));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/ta resources", "reroll_all_resources", translator.of("townyresources.admin_help_reroll")));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/ta resources", "reroll_all_resources [townname]", translator.of("townyresources.admin_help_reroll_one_town")));
TownyMessaging.sendMessage(sender, ChatTools.formatCommand("Eg", "/ta resources", "bypass", translator.of("townyresources.admin_help_bypass")));
}

private void parseReloadCommand(CommandSender sender) {
Expand Down

0 comments on commit 38883c1

Please sign in to comment.