Just started adding in the universe toggle.

This commit is contained in:
Olof Larsson 2013-04-25 12:18:39 +02:00
parent 8fd088e291
commit ac2c7c705c
7 changed files with 27 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
public class ChatTagName extends ChatTagAbstract public class ChatTagName extends ChatTagAbstract
@ -21,6 +22,7 @@ public class ChatTagName extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
if (!UConf.get(fsender).enabled) return "";
Faction faction = fsender.getFaction(); Faction faction = fsender.getFaction();
if (faction.isNone()) return ""; if (faction.isNone()) return "";
return faction.getName(); return faction.getName();

View File

@ -1,6 +1,8 @@
package com.massivecraft.factions.chat.tag; package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
public class ChatTagNameforce extends ChatTagAbstract public class ChatTagNameforce extends ChatTagAbstract
@ -20,7 +22,9 @@ public class ChatTagNameforce extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
return fsender.getFaction().getName(); if (!UConf.get(fsender).enabled) return "";
Faction faction = fsender.getFaction();
return faction.getName();
} }
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.chat.tag; package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
public class ChatTagRelcolor extends ChatTagAbstract public class ChatTagRelcolor extends ChatTagAbstract
@ -20,7 +21,8 @@ public class ChatTagRelcolor extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
if (fsender == null) return ""; if (!UConf.get(fsender).enabled) return "";
if (frecipient == null) return ""; if (frecipient == null) return "";
return frecipient.getRelationTo(fsender).getColor().toString(); return frecipient.getRelationTo(fsender).getColor().toString();

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.chat.tag; package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
@ -20,7 +21,9 @@ public class ChatTagRole extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
if (!UConf.get(fsender).enabled) return "";
return Txt.upperCaseFirst(fsender.getRole().toString().toLowerCase()); return Txt.upperCaseFirst(fsender.getRole().toString().toLowerCase());
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.chat.tag; package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
public class ChatTagRoleprefix extends ChatTagAbstract public class ChatTagRoleprefix extends ChatTagAbstract
@ -19,7 +20,9 @@ public class ChatTagRoleprefix extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
if (!UConf.get(fsender).enabled) return "";
return fsender.getRole().getPrefix(); return fsender.getRole().getPrefix();
} }

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.chat.tag; package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract; import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.UPlayer;
public class ChatTagTitle extends ChatTagAbstract public class ChatTagTitle extends ChatTagAbstract
@ -20,6 +21,8 @@ public class ChatTagTitle extends ChatTagAbstract
@Override @Override
public String getReplacement(UPlayer fsender, UPlayer frecipient) public String getReplacement(UPlayer fsender, UPlayer frecipient)
{ {
if (!UConf.get(fsender).enabled) return "";
if (!fsender.hasTitle()) return ""; if (!fsender.hasTitle()) return "";
return fsender.getTitle(); return fsender.getTitle();
} }

View File

@ -24,6 +24,12 @@ public class UConf extends Entity<UConf>
return UConfColls.get().get2(oid); return UConfColls.get().get2(oid);
} }
// -------------------------------------------- //
// UNIVERSE ENABLE SWITCH
// -------------------------------------------- //
public boolean enabled = true;
// -------------------------------------------- // // -------------------------------------------- //
// SPECIAL FACTION IDS // SPECIAL FACTION IDS
// -------------------------------------------- // // -------------------------------------------- //