1.6.1 stuff

This commit is contained in:
Brettflan 2011-12-16 00:19:41 -06:00
parent 44241d87ba
commit e0aaa395a7
3 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.*;
import com.massivecraft.factions.zcore.persist.Entity;
import com.nijikokun.register.payment.Method.MethodAccount;
import java.util.logging.Level;
public class Faction extends Entity implements EconomyParticipator
@ -122,6 +123,11 @@ public class Faction extends Entity implements EconomyParticipator
// We need to override the default money given to players.
if ( ! Econ.getMethod().hasAccount(aid))
{
if ( ! Econ.getMethod().createAccount(aid))
{
P.p.log(Level.SEVERE, "Error creating faction bank account through Register: "+aid);
return null;
}
MethodAccount acc = Econ.getMethod().getAccount(aid);
acc.set(0);
}

View File

@ -19,6 +19,7 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.RelationUtil;
import java.util.logging.Level;
public class Econ
{
@ -81,6 +82,11 @@ public class Econ
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about)
{
if (!shouldBeUsed())
{
P.p.log(Level.WARNING, "Register does not appear to be hooked into an economy plugin.");
return;
}
to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(about.getAccount().balance()));
}

View File

@ -45,9 +45,10 @@ public class FactionsChatEarlyListener extends PlayerListener
// Is it a faction chat message?
if (me.getChatMode() == ChatMode.FACTION)
{
Faction myFaction = me.getFaction();
String message = String.format(Conf.factionChatFormat, me.describeTo(me), msg);
me.getFaction().sendMessage(message);
String message = String.format(Conf.factionChatFormat, me.describeTo(myFaction), msg);
myFaction.sendMessage(message);
P.p.log(Level.INFO, ChatColor.stripColor("FactionChat "+me.getFaction().getTag()+": "+message));