From 9f8f125a92453072022037a32326f5dcdb69d293 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Mon, 26 Sep 2011 16:44:20 +0100 Subject: [PATCH] f balance now accepts an optional parameter. f who now shows balance of the faction. --- .../massivecraft/factions/commands/FCommandBalance.java | 9 ++++++--- src/com/massivecraft/factions/commands/FCommandShow.java | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/commands/FCommandBalance.java b/src/com/massivecraft/factions/commands/FCommandBalance.java index ff3fd00b..15a6e999 100644 --- a/src/com/massivecraft/factions/commands/FCommandBalance.java +++ b/src/com/massivecraft/factions/commands/FCommandBalance.java @@ -10,7 +10,9 @@ public class FCommandBalance extends FBaseCommand { aliases.add("balance"); aliases.add("money"); - helpDescription = "Shows the faction's current balance"; + optionalParameters.add("faction name"); + + helpDescription = "Shows a faction's current balance"; } @Override @@ -23,9 +25,10 @@ public class FCommandBalance extends FBaseCommand { return; } - Faction faction = me.getFaction(); + String factionName = parameters.get(0); + Faction faction = findFaction(factionName, true); - sendMessage(Conf.colorChrome+"Balance: "+ Econ.moneyString(faction.getMoney())); + sendMessage(Conf.colorChrome+faction.getTag()+"'s balance: "+ Econ.moneyString(faction.getMoney())); } } diff --git a/src/com/massivecraft/factions/commands/FCommandShow.java b/src/com/massivecraft/factions/commands/FCommandShow.java index 363a926e..b1e98527 100644 --- a/src/com/massivecraft/factions/commands/FCommandShow.java +++ b/src/com/massivecraft/factions/commands/FCommandShow.java @@ -83,6 +83,11 @@ public class FCommandShow extends FBaseCommand { String stringRefund = (refund > 0.0) ? (" ("+Econ.moneyString(refund)+" depreciated)") : ""; sendMessage(Conf.colorChrome+"Total land value: " + Conf.colorSystem + stringValue + stringRefund); } + + //Show bank contents + if(Conf.bankEnabled) { + sendMessage(Conf.colorChrome+"Bank contains: " + Conf.colorSystem + Econ.moneyString(faction.getMoney())); + } } String listpart;