From ec8be2d2c0d8ef432159890f226ae9a04e7b0fb1 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 22 Apr 2013 09:41:48 +0200 Subject: [PATCH] Moving colors to MConf --- src/com/massivecraft/factions/ConfServer.java | 12 ------------ src/com/massivecraft/factions/Rel.java | 12 +++++++----- src/com/massivecraft/factions/entity/MConf.java | 14 +++++++++++++- .../massivecraft/factions/util/RelationUtil.java | 6 +++--- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/com/massivecraft/factions/ConfServer.java b/src/com/massivecraft/factions/ConfServer.java index f8d2b81d..67be8905 100644 --- a/src/com/massivecraft/factions/ConfServer.java +++ b/src/com/massivecraft/factions/ConfServer.java @@ -25,19 +25,7 @@ public class ConfServer extends SimpleConfig public static List baseCommandAliases = MUtil.list("f"); 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) diff --git a/src/com/massivecraft/factions/Rel.java b/src/com/massivecraft/factions/Rel.java index fa56e99b..9f353cde 100644 --- a/src/com/massivecraft/factions/Rel.java +++ b/src/com/massivecraft/factions/Rel.java @@ -2,6 +2,8 @@ package com.massivecraft.factions; import org.bukkit.ChatColor; +import com.massivecraft.factions.entity.MConf; + public enum Rel { @@ -119,15 +121,15 @@ public enum Rel public ChatColor getColor() { if (this.isAtLeast(RECRUIT)) - return ConfServer.colorMember; + return MConf.get().colorMember; else if (this == ALLY) - return ConfServer.colorAlly; + return MConf.get().colorAlly; else if (this == NEUTRAL) - return ConfServer.colorNeutral; + return MConf.get().colorNeutral; else if (this == TRUCE) - return ConfServer.colorTruce; + return MConf.get().colorTruce; else - return ConfServer.colorEnemy; + return MConf.get().colorEnemy; } public String getPrefix() diff --git a/src/com/massivecraft/factions/entity/MConf.java b/src/com/massivecraft/factions/entity/MConf.java index 5e4da7c7..e6bd0a67 100644 --- a/src/com/massivecraft/factions/entity/MConf.java +++ b/src/com/massivecraft/factions/entity/MConf.java @@ -1,5 +1,7 @@ package com.massivecraft.factions.entity; +import org.bukkit.ChatColor; + import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.store.Entity; @@ -15,8 +17,18 @@ public class MConf extends Entity } // -------------------------------------------- // - // 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; + } \ No newline at end of file diff --git a/src/com/massivecraft/factions/util/RelationUtil.java b/src/com/massivecraft/factions/util/RelationUtil.java index c597e1e9..d9a1deec 100644 --- a/src/com/massivecraft/factions/util/RelationUtil.java +++ b/src/com/massivecraft/factions/util/RelationUtil.java @@ -2,12 +2,12 @@ package com.massivecraft.factions.util; import org.bukkit.ChatColor; -import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FFlag; import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; import com.massivecraft.factions.entity.FPlayer; import com.massivecraft.factions.entity.Faction; +import com.massivecraft.factions.entity.MConf; import com.massivecraft.mcore.util.Txt; public class RelationUtil @@ -135,12 +135,12 @@ public class RelationUtil { if (thatFaction.getFlag(FFlag.FRIENDLYFIRE) == true) { - return ConfServer.colorFriendlyFire; + return MConf.get().colorFriendlyFire; } if (thatFaction.getFlag(FFlag.PVP) == false) { - return ConfServer.colorNoPVP; + return MConf.get().colorNoPVP; } } return getRelationOfThatToMe(that, me).getColor();