Added faction banks.

This commit is contained in:
Harry Jeffery
2011-09-24 02:22:53 +01:00
parent 31937b6756
commit 2b23f93fba
13 changed files with 363 additions and 21 deletions

View File

@@ -623,11 +623,23 @@ public class FPlayer {
if (Econ.enabled() && !Conf.adminBypassPlayers.contains(this.playerName)) {
double cost = Econ.calculateClaimCost(ownedLand, otherFaction.isNormal());
String costString = Econ.moneyString(cost);
if (!Econ.deductMoney(this.playerName, cost)) {
sendMessage("Claiming this land will cost "+costString+", which you can't currently afford.");
return false;
if(Conf.bankFactionPaysLandCosts && this.hasFaction()) {
Faction faction = this.getFaction();
if(!faction.removeMoney(cost)) {
sendMessage("It costs "+costString+" to claim this land, which your faction can't currently afford.");
return false;
} else {
sendMessage(faction.getTag()+" has paid "+costString+" to claim some land.");
}
} else {
if (!Econ.deductMoney(this.playerName, cost)) {
sendMessage("Claiming this land will cost "+costString+", which you can't currently afford.");
return false;
}
sendMessage("You have paid "+costString+" to claim this land.");
}
sendMessage("You have paid "+costString+" to claim this land.");
}
// announce success