1.6.1 stuff
This commit is contained in:
parent
44241d87ba
commit
e0aaa395a7
@ -17,6 +17,7 @@ import com.massivecraft.factions.struct.Role;
|
|||||||
import com.massivecraft.factions.util.*;
|
import com.massivecraft.factions.util.*;
|
||||||
import com.massivecraft.factions.zcore.persist.Entity;
|
import com.massivecraft.factions.zcore.persist.Entity;
|
||||||
import com.nijikokun.register.payment.Method.MethodAccount;
|
import com.nijikokun.register.payment.Method.MethodAccount;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
|
||||||
public class Faction extends Entity implements EconomyParticipator
|
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.
|
// We need to override the default money given to players.
|
||||||
if ( ! Econ.getMethod().hasAccount(aid))
|
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);
|
MethodAccount acc = Econ.getMethod().getAccount(aid);
|
||||||
acc.set(0);
|
acc.set(0);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class Econ
|
public class Econ
|
||||||
{
|
{
|
||||||
@ -81,6 +82,11 @@ public class Econ
|
|||||||
|
|
||||||
public static void sendBalanceInfo(FPlayer to, EconomyParticipator about)
|
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()));
|
to.msg("<a>%s's<i> balance is <h>%s<i>.", about.describeTo(to, true), Econ.moneyString(about.getAccount().balance()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +45,10 @@ public class FactionsChatEarlyListener extends PlayerListener
|
|||||||
// Is it a faction chat message?
|
// Is it a faction chat message?
|
||||||
if (me.getChatMode() == ChatMode.FACTION)
|
if (me.getChatMode() == ChatMode.FACTION)
|
||||||
{
|
{
|
||||||
|
Faction myFaction = me.getFaction();
|
||||||
|
|
||||||
String message = String.format(Conf.factionChatFormat, me.describeTo(me), msg);
|
String message = String.format(Conf.factionChatFormat, me.describeTo(myFaction), msg);
|
||||||
me.getFaction().sendMessage(message);
|
myFaction.sendMessage(message);
|
||||||
|
|
||||||
P.p.log(Level.INFO, ChatColor.stripColor("FactionChat "+me.getFaction().getTag()+": "+message));
|
P.p.log(Level.INFO, ChatColor.stripColor("FactionChat "+me.getFaction().getTag()+": "+message));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user