Merge branch 'master' of github.com:MassiveCraft/Factions

This commit is contained in:
Olof Larsson 2011-11-24 16:27:23 +01:00
commit fc6bfcf061
9 changed files with 14 additions and 10 deletions

Binary file not shown.

View File

@ -608,7 +608,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
double cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); double cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal());
//String costString = Econ.moneyString(cost); //String costString = Econ.moneyString(cost);
if(Conf.bankFactionPaysLandCosts && this.hasFaction()) if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts && this.hasFaction())
{ {
Faction faction = this.getFaction(); Faction faction = this.getFaction();
if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false; if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false;

View File

@ -92,7 +92,7 @@ public class Faction extends Entity implements EconomyParticipator
if ( ! Econ.getMethod().createAccount(aid)) if ( ! Econ.getMethod().createAccount(aid))
{ {
P.p.log(Level.SEVERE, "Error creating faction bank account through Register: "+aid); P.p.log(Level.SEVERE, "Error creating faction bank account through Register: "+aid);
return null; // return null;
} }
MethodAccount acc = Econ.getMethod().getAccount(aid); MethodAccount acc = Econ.getMethod().getAccount(aid);
acc.set(0); acc.set(0);

View File

@ -38,7 +38,7 @@ public class CmdDescription extends FCommand
for (FPlayer fplayer : FPlayers.i.getOnline()) for (FPlayer fplayer : FPlayers.i.getOnline())
{ {
fplayer.msg("<h>%s<i> changed their description to:", myFaction.describeTo(fplayer)); fplayer.msg("<h>%s<i> changed their description to:", myFaction.describeTo(fplayer));
fplayer.msg("<h>"+myFaction.getDescription()); fplayer.msg("<i>"+myFaction.getDescription());
} }
} }

View File

@ -42,7 +42,7 @@ public class CmdUnclaim extends FCommand
{ {
double refund = Econ.calculateClaimRefund(myFaction.getLandRounded()); double refund = Econ.calculateClaimRefund(myFaction.getLandRounded());
if(Conf.bankFactionPaysLandCosts) if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts)
{ {
if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return; if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return;
} }

View File

@ -32,7 +32,7 @@ public class CmdUnclaimall extends FCommand
if (Econ.shouldBeUsed()) if (Econ.shouldBeUsed())
{ {
double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded()); double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded());
if(Conf.bankFactionPaysLandCosts) if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts)
{ {
if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return; if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return;
} }

View File

@ -389,7 +389,7 @@ public abstract class FCommand extends MCommand<P>
{ {
if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true; if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true;
if(Conf.bankFactionPaysLandCosts && fme.hasFaction()) if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction())
{ {
if ( ! Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis)) return false; if ( ! Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis)) return false;
} }

View File

@ -254,11 +254,14 @@ public class Econ
if ( ! shouldBeUsed()) return; if ( ! shouldBeUsed()) return;
for (Faction faction : Factions.i.get()) for (Faction faction : Factions.i.get())
{
if (faction.money > 0)
{ {
faction.getAccount().add(faction.money); faction.getAccount().add(faction.money);
faction.money = 0; faction.money = 0;
} }
} }
}
// calculate the cost for claiming land // calculate the cost for claiming land
public static double calculateClaimCost(int ownedLand, boolean takingFromAnotherFaction) public static double calculateClaimCost(int ownedLand, boolean takingFromAnotherFaction)

View File

@ -194,11 +194,12 @@ public class SpoutFeatures
if (viewedFaction == null) if (viewedFaction == null)
return; return;
SpoutPlayer sPlayer = SpoutManager.getPlayer(viewer.getPlayer());
Player pViewed = viewed.getPlayer(); Player pViewed = viewed.getPlayer();
if (pViewed == null || viewer.getPlayer() == null) Player pViewer = viewer.getPlayer();
if (pViewed == null || pViewer == null)
return; return;
SpoutPlayer sPlayer = SpoutManager.getPlayer(pViewer);
String viewedTitle = viewed.getTitle(); String viewedTitle = viewed.getTitle();
Rel viewedRole = viewed.getRole(); Rel viewedRole = viewed.getRole();