From 3a989f5110912c4a9c2e02fe08f40e2d900ac314 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 6 Apr 2013 05:54:44 +0100 Subject: Balance others message. --- .../essentials/commands/Commandbalance.java | 23 ++++++++++++++-------- Essentials/src/messages.properties | 1 + Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fi.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + Essentials/src/messages_se.properties | 1 + 14 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index fde83a561..062709bd4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -21,18 +21,25 @@ public class Commandbalance extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(server, args, 0, true, true).getMoney(), ess))); + + User target = getPlayer(server, args, 0, true, true); + sender.sendMessage(_("balanceOther", target.getDisplayName(), Util.displayCurrency(target.getMoney(), ess))); } @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - //TODO: Remove 'other' perm - final double bal = (args.length < 1 - || !(user.isAuthorized("essentials.balance.others") - || user.isAuthorized("essentials.balance.other")) - ? user - : getPlayer(server, args, 0, true, true)).getMoney(); - user.sendMessage(_("balance", Util.displayCurrency(bal, ess))); + + if (args.length < 1 || !user.isAuthorized("essentials.balance.others")) + { + final double bal = user.getMoney(); + user.sendMessage(_("balance", Util.displayCurrency(bal, ess))); + } + else + { + final User target = getPlayer(server, args, 0, true, true); + final double bal = target.getMoney(); + user.sendMessage(_("balanceOther", target.getDisplayName(), Util.displayCurrency(bal, ess))); + } } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b16549480..9350a4896 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 64e24ef7c..4ff0431aa 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -526,3 +526,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 96a4bacd7..89ac878fd 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 51e0ed7d2..8a1f3b2f9 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index b16549480..9350a4896 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 31bb0393a..afd04979b 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index 46a5b74f9..02c0fa436 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 437486f72..f49121394 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 5994a4ee1..420441229 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 3177ed485..02bd1c6fa 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index c0cac55a3..68a093cd4 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a77Graczowi\u00a7c {0} \u00a77 odbanowano IP: {1}. playerBanIpAddress=\u00a77Gracz\u00a7c {0} \u00a77zostal zbanowany na adres IP {1}\u00a77. noPotionEffectPerm=\u00a74Nie masz praw by dodac efekt \u00a7c{0} \u00a74tej miksturze. invalidPotionMeta=\u00a74Niepoprawna wartosc mikstury: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 015d10d60..2d2cf3d1c 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index 14a1cf677..879c8664c 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -523,3 +523,4 @@ playerUnbanIpAddress=\u00a76Player\u00a7c {0} \u00a76unbanned IP: {1}. playerBanIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1}\u00a76. noPotionEffectPerm=\u00a74You do not have permission to apply potion effect \u00a7c{0} \u00a74to this potion. invalidPotionMeta=\u00a74Invalid potion meta: \u00a7c{0}\u00a74. +balanceOther=\u00a7aBalance of {0}\u00a7a:\u00a7c {1} -- cgit v1.2.3