diff --git a/src/main/java/net/knarcraft/playerpayouts/PlayerPayouts.java b/src/main/java/net/knarcraft/playerpayouts/PlayerPayouts.java index c14b1fa..2556f8e 100644 --- a/src/main/java/net/knarcraft/playerpayouts/PlayerPayouts.java +++ b/src/main/java/net/knarcraft/playerpayouts/PlayerPayouts.java @@ -40,7 +40,6 @@ public final class PlayerPayouts extends JavaPlugin { private Configuration configuration; private IEssentials essentials = null; - private Translator translator; private StringFormatter stringFormatter; private static PlayerPayouts playerPayouts; @@ -55,7 +54,7 @@ public final class PlayerPayouts extends JavaPlugin { this.saveConfig(); this.configuration = new Configuration(fileConfiguration); - translator = new Translator(); + Translator translator = new Translator(); translator.registerMessageCategory(Translatable.GROUP_PAYOUTS_UNAVAILABLE); translator.loadLanguages(this.getDataFolder(), "en", fileConfiguration.getString("language", "en")); @@ -143,15 +142,6 @@ public final class PlayerPayouts extends JavaPlugin { return getInstance().stringFormatter; } - /** - * Gets the translator - * - * @return

A translator

- */ - public static Translator getTranslator() { - return getInstance().translator; - } - /** * Pay all players that have been on the server long enough */ diff --git a/src/main/java/net/knarcraft/playerpayouts/command/SetGroupPaymentCommand.java b/src/main/java/net/knarcraft/playerpayouts/command/SetGroupPaymentCommand.java index f7e6906..fd4dc6b 100644 --- a/src/main/java/net/knarcraft/playerpayouts/command/SetGroupPaymentCommand.java +++ b/src/main/java/net/knarcraft/playerpayouts/command/SetGroupPaymentCommand.java @@ -83,8 +83,8 @@ public class SetGroupPaymentCommand implements CommandExecutor { Double payout = Double.parseDouble(arguments[1]); configuration.setGroupPayout(group, payout); stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders( - Translatable.GROUP_PAYOUT_SET, new String[]{"{group}", "{value}"}, - new String[]{group, String.valueOf(payout)})); + Translatable.GROUP_PAYOUT_SET, List.of("{group}", "{value}"), + List.of(group, String.valueOf(payout)))); } return true; } catch (NumberFormatException exception) { diff --git a/src/main/java/net/knarcraft/playerpayouts/command/SetPlayerPaymentCommand.java b/src/main/java/net/knarcraft/playerpayouts/command/SetPlayerPaymentCommand.java index aca0d9a..c572d01 100644 --- a/src/main/java/net/knarcraft/playerpayouts/command/SetPlayerPaymentCommand.java +++ b/src/main/java/net/knarcraft/playerpayouts/command/SetPlayerPaymentCommand.java @@ -89,8 +89,8 @@ public class SetPlayerPaymentCommand implements CommandExecutor { Double payout = Double.parseDouble(arguments[1]); configuration.setPlayerPayout(playerId, payout); stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders( - Translatable.PLAYER_PAYOUT_SET, new String[]{"{player}", "{value}"}, - new String[]{playerName, String.valueOf(payout)})); + Translatable.PLAYER_PAYOUT_SET, List.of("{player}", "{value}"), + List.of(playerName, String.valueOf(payout)))); } return true; } catch (NumberFormatException exception) {