Updates some KnarLib code
All checks were successful
KnarCraft/PlayerPayouts/pipeline/head This commit looks good
All checks were successful
KnarCraft/PlayerPayouts/pipeline/head This commit looks good
This commit is contained in:
parent
72722029f9
commit
a5d9c949b9
@ -40,7 +40,6 @@ public final class PlayerPayouts extends JavaPlugin {
|
|||||||
|
|
||||||
private Configuration configuration;
|
private Configuration configuration;
|
||||||
private IEssentials essentials = null;
|
private IEssentials essentials = null;
|
||||||
private Translator translator;
|
|
||||||
private StringFormatter stringFormatter;
|
private StringFormatter stringFormatter;
|
||||||
private static PlayerPayouts playerPayouts;
|
private static PlayerPayouts playerPayouts;
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ public final class PlayerPayouts extends JavaPlugin {
|
|||||||
this.saveConfig();
|
this.saveConfig();
|
||||||
this.configuration = new Configuration(fileConfiguration);
|
this.configuration = new Configuration(fileConfiguration);
|
||||||
|
|
||||||
translator = new Translator();
|
Translator translator = new Translator();
|
||||||
translator.registerMessageCategory(Translatable.GROUP_PAYOUTS_UNAVAILABLE);
|
translator.registerMessageCategory(Translatable.GROUP_PAYOUTS_UNAVAILABLE);
|
||||||
translator.loadLanguages(this.getDataFolder(), "en",
|
translator.loadLanguages(this.getDataFolder(), "en",
|
||||||
fileConfiguration.getString("language", "en"));
|
fileConfiguration.getString("language", "en"));
|
||||||
@ -143,15 +142,6 @@ public final class PlayerPayouts extends JavaPlugin {
|
|||||||
return getInstance().stringFormatter;
|
return getInstance().stringFormatter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the translator
|
|
||||||
*
|
|
||||||
* @return <p>A translator</p>
|
|
||||||
*/
|
|
||||||
public static Translator getTranslator() {
|
|
||||||
return getInstance().translator;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pay all players that have been on the server long enough
|
* Pay all players that have been on the server long enough
|
||||||
*/
|
*/
|
||||||
|
@ -83,8 +83,8 @@ public class SetGroupPaymentCommand implements CommandExecutor {
|
|||||||
Double payout = Double.parseDouble(arguments[1]);
|
Double payout = Double.parseDouble(arguments[1]);
|
||||||
configuration.setGroupPayout(group, payout);
|
configuration.setGroupPayout(group, payout);
|
||||||
stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders(
|
stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders(
|
||||||
Translatable.GROUP_PAYOUT_SET, new String[]{"{group}", "{value}"},
|
Translatable.GROUP_PAYOUT_SET, List.of("{group}", "{value}"),
|
||||||
new String[]{group, String.valueOf(payout)}));
|
List.of(group, String.valueOf(payout))));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (NumberFormatException exception) {
|
} catch (NumberFormatException exception) {
|
||||||
|
@ -89,8 +89,8 @@ public class SetPlayerPaymentCommand implements CommandExecutor {
|
|||||||
Double payout = Double.parseDouble(arguments[1]);
|
Double payout = Double.parseDouble(arguments[1]);
|
||||||
configuration.setPlayerPayout(playerId, payout);
|
configuration.setPlayerPayout(playerId, payout);
|
||||||
stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders(
|
stringFormatter.displaySuccessMessage(commandSender, stringFormatter.replacePlaceholders(
|
||||||
Translatable.PLAYER_PAYOUT_SET, new String[]{"{player}", "{value}"},
|
Translatable.PLAYER_PAYOUT_SET, List.of("{player}", "{value}"),
|
||||||
new String[]{playerName, String.valueOf(payout)}));
|
List.of(playerName, String.valueOf(payout))));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (NumberFormatException exception) {
|
} catch (NumberFormatException exception) {
|
||||||
|
Loading…
Reference in New Issue
Block a user