mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-27 19:37:48 +01:00
payments may not always contain each of money/points/exp Corpium/Corpium#122
This commit is contained in:
parent
3036325b72
commit
55b9d4f3b7
@ -110,45 +110,45 @@ public class JobsPaymentVisualizationListener implements Listener {
|
||||
return;
|
||||
|
||||
if (!Jobs.getGeneralConfigManager().ActionBarEnabled) {
|
||||
showChatMessage(player, event.getPayment());
|
||||
showChatMessage(player, event);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageToggleState state = ToggleBarHandling.getActionBarState(event.getPlayer().getUniqueId());
|
||||
|
||||
if (!state.equals(MessageToggleState.Batched)) {
|
||||
showChatMessage(player, event.getPayment());
|
||||
showChatMessage(player, event);
|
||||
return;
|
||||
}
|
||||
|
||||
String message = generateDelayedMessage(event.getPayment());
|
||||
String message = generateDelayedMessage(event);
|
||||
if (!message.isEmpty())
|
||||
CMIActionBar.send(player, message);
|
||||
return;
|
||||
}
|
||||
|
||||
private static void showChatMessage(Player player, Map<CurrencyType, Double> payment) {
|
||||
private static void showChatMessage(Player player, JobsPaymentEvent event) {
|
||||
MessageToggleState chatState = ToggleBarHandling.getChatTextState(player.getUniqueId());
|
||||
if (chatState.equals(MessageToggleState.Off))
|
||||
return;
|
||||
String message = generateDelayedMessage(payment);
|
||||
String message = generateDelayedMessage(event);
|
||||
|
||||
if (!message.isEmpty())
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
||||
private static String generateDelayedMessage(Map<CurrencyType, Double> payment) {
|
||||
private static String generateDelayedMessage(JobsPaymentEvent event) {
|
||||
|
||||
String message = Jobs.getLanguage().getMessage("command.toggle.output.paid.main");
|
||||
double money = payment.get(CurrencyType.MONEY);
|
||||
double money = event.get(CurrencyType.MONEY);
|
||||
if (money != 0D)
|
||||
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.money", "[amount]", String.format(Jobs.getGCManager().getDecimalPlacesMoney(), money));
|
||||
|
||||
double points = payment.get(CurrencyType.POINTS);
|
||||
double points = event.get(CurrencyType.POINTS);
|
||||
if (points != 0D)
|
||||
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.points", "[points]", String.format(Jobs.getGCManager().getDecimalPlacesPoints(), points));
|
||||
|
||||
double exp = payment.get(CurrencyType.EXP);
|
||||
double exp = event.get(CurrencyType.EXP);
|
||||
if (exp != 0D)
|
||||
message += " " + Jobs.getLanguage().getMessage("command.toggle.output.paid.exp", "[exp]", String.format(Jobs.getGCManager().getDecimalPlacesExp(), exp));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user