Moving colors to MConf

This commit is contained in:
Olof Larsson 2013-04-22 09:41:48 +02:00
parent 41bb3f6e05
commit ec8be2d2c0
4 changed files with 23 additions and 21 deletions

View File

@ -25,19 +25,7 @@ public class ConfServer extends SimpleConfig
public static List<String> baseCommandAliases = MUtil.list("f"); public static List<String> baseCommandAliases = MUtil.list("f");
public static String dburi = "default"; public static String dburi = "default";
// -------------------------------------------- //
// COLORS
// -------------------------------------------- //
public static ChatColor colorMember = ChatColor.GREEN;
public static ChatColor colorAlly = ChatColor.DARK_PURPLE;
public static ChatColor colorTruce = ChatColor.LIGHT_PURPLE;
public static ChatColor colorNeutral = ChatColor.WHITE;
public static ChatColor colorEnemy = ChatColor.RED;
public static ChatColor colorNoPVP = ChatColor.GOLD;
public static ChatColor colorFriendlyFire = ChatColor.DARK_RED;
//public static ChatColor colorWilderness = ChatColor.DARK_GREEN;
// -------------------------------------------- // // -------------------------------------------- //
// DOUBTFULLY CONFIGURABLE DEFAULTS (TODO) // DOUBTFULLY CONFIGURABLE DEFAULTS (TODO)

View File

@ -2,6 +2,8 @@ package com.massivecraft.factions;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import com.massivecraft.factions.entity.MConf;
public enum Rel public enum Rel
{ {
@ -119,15 +121,15 @@ public enum Rel
public ChatColor getColor() public ChatColor getColor()
{ {
if (this.isAtLeast(RECRUIT)) if (this.isAtLeast(RECRUIT))
return ConfServer.colorMember; return MConf.get().colorMember;
else if (this == ALLY) else if (this == ALLY)
return ConfServer.colorAlly; return MConf.get().colorAlly;
else if (this == NEUTRAL) else if (this == NEUTRAL)
return ConfServer.colorNeutral; return MConf.get().colorNeutral;
else if (this == TRUCE) else if (this == TRUCE)
return ConfServer.colorTruce; return MConf.get().colorTruce;
else else
return ConfServer.colorEnemy; return MConf.get().colorEnemy;
} }
public String getPrefix() public String getPrefix()

View File

@ -1,5 +1,7 @@
package com.massivecraft.factions.entity; package com.massivecraft.factions.entity;
import org.bukkit.ChatColor;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.store.Entity; import com.massivecraft.mcore.store.Entity;
@ -15,8 +17,18 @@ public class MConf extends Entity<MConf>
} }
// -------------------------------------------- // // -------------------------------------------- //
// FIELDS // COLORS
// -------------------------------------------- // // -------------------------------------------- //
public ChatColor colorMember = ChatColor.GREEN;
public ChatColor colorAlly = ChatColor.DARK_PURPLE;
public ChatColor colorTruce = ChatColor.LIGHT_PURPLE;
public ChatColor colorNeutral = ChatColor.WHITE;
public ChatColor colorEnemy = ChatColor.RED;
public ChatColor colorNoPVP = ChatColor.GOLD;
public ChatColor colorFriendlyFire = ChatColor.DARK_RED;
//public ChatColor colorWilderness = ChatColor.DARK_GREEN;
} }

View File

@ -2,12 +2,12 @@ package com.massivecraft.factions.util;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.FFlag; import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.Rel; import com.massivecraft.factions.Rel;
import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.RelationParticipator;
import com.massivecraft.factions.entity.FPlayer; import com.massivecraft.factions.entity.FPlayer;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
public class RelationUtil public class RelationUtil
@ -135,12 +135,12 @@ public class RelationUtil
{ {
if (thatFaction.getFlag(FFlag.FRIENDLYFIRE) == true) if (thatFaction.getFlag(FFlag.FRIENDLYFIRE) == true)
{ {
return ConfServer.colorFriendlyFire; return MConf.get().colorFriendlyFire;
} }
if (thatFaction.getFlag(FFlag.PVP) == false) if (thatFaction.getFlag(FFlag.PVP) == false)
{ {
return ConfServer.colorNoPVP; return MConf.get().colorNoPVP;
} }
} }
return getRelationOfThatToMe(that, me).getColor(); return getRelationOfThatToMe(that, me).getColor();