Only handle faction tags. No standard ones.

This commit is contained in:
Olof Larsson 2013-04-18 15:31:05 +02:00
parent e9b2b4ee66
commit 5e481d4120
12 changed files with 69 additions and 144 deletions

View File

@ -109,7 +109,7 @@ public class ConfServer extends SimpleConfig
// We offer a simple standard way to set the format
public static boolean chatSetFormat = false;
public static EventPriority chatSetFormatAt = EventPriority.LOWEST;
public static String chatSetFormatTo = "<{faction_relcolor}§l{faction_roleprefix}§r{faction_relcolor}{faction_tag_pr}§f%s> %s";
public static String chatSetFormatTo = "<§l{factions_roleprefix}§r{factions_relcolor}{factions_tag|rp}§f%1$s> %2$s";
// We offer a simple standard way to parse the chat tags
public static boolean chatParseTags = true;

View File

@ -6,6 +6,18 @@ import com.massivecraft.factions.adapters.FFlagAdapter;
import com.massivecraft.factions.adapters.FPermAdapter;
import com.massivecraft.factions.adapters.RelAdapter;
import com.massivecraft.factions.adapters.TerritoryAccessAdapter;
import com.massivecraft.factions.chat.modifier.ChatModifierLc;
import com.massivecraft.factions.chat.modifier.ChatModifierLp;
import com.massivecraft.factions.chat.modifier.ChatModifierParse;
import com.massivecraft.factions.chat.modifier.ChatModifierRp;
import com.massivecraft.factions.chat.modifier.ChatModifierUc;
import com.massivecraft.factions.chat.modifier.ChatModifierUcf;
import com.massivecraft.factions.chat.tag.ChatTagRelcolor;
import com.massivecraft.factions.chat.tag.ChatTagRole;
import com.massivecraft.factions.chat.tag.ChatTagRoleprefix;
import com.massivecraft.factions.chat.tag.ChatTagTag;
import com.massivecraft.factions.chat.tag.ChatTagTagforce;
import com.massivecraft.factions.chat.tag.ChatTagTitle;
import com.massivecraft.factions.cmd.*;
import com.massivecraft.factions.integration.herochat.HerochatFeatures;
import com.massivecraft.factions.integration.Econ;
@ -67,21 +79,7 @@ public class Factions extends MPlugin
this.outerCmdFactions = new CmdFactions();
this.outerCmdFactions.register(this);
SpoutFeatures.setup();
Econ.setup();
HerochatFeatures.setup();
LWCFeatures.setup();
if (ConfServer.worldGuardChecking)
{
Worldguard.init(this);
}
// Schedule recurring non-tps-dependent tasks
AutoLeaveTask.get().schedule(this);
EconLandRewardTask.get().schedule(this);
// Register Event Handlers
// Setup Listeners
FactionsListenerMain.get().setup();
FactionsListenerChat.get().setup();
FactionsListenerExploit.get().setup();
@ -93,6 +91,37 @@ public class Factions extends MPlugin
this.entityListener = new TodoFactionsEntityListener();
getServer().getPluginManager().registerEvents(this.entityListener, this);
// Schedule recurring non-tps-dependent tasks
AutoLeaveTask.get().schedule(this);
EconLandRewardTask.get().schedule(this);
// Register built in chat modifiers
ChatModifierLc.get().register();
ChatModifierLp.get().register();
ChatModifierParse.get().register();
ChatModifierRp.get().register();
ChatModifierUc.get().register();
ChatModifierUcf.get().register();
// Register built in chat tags
ChatTagRelcolor.get().register();
ChatTagRole.get().register();
ChatTagRoleprefix.get().register();
ChatTagTag.get().register();
ChatTagTagforce.get().register();
ChatTagTitle.get().register();
// Integrate
SpoutFeatures.setup();
Econ.setup();
HerochatFeatures.setup();
LWCFeatures.setup();
if (ConfServer.worldGuardChecking)
{
Worldguard.init(this);
}
postEnable();
}

View File

@ -4,15 +4,15 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
public class ChatTagFactionRelcolor extends ChatTagAbstract
public class ChatTagRelcolor extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionRelcolor() { super("factions_relcolor"); }
private static ChatTagFactionRelcolor i = new ChatTagFactionRelcolor();
public static ChatTagFactionRelcolor get() { return i; }
private ChatTagRelcolor() { super("factions_relcolor"); }
private static ChatTagRelcolor i = new ChatTagRelcolor();
public static ChatTagRelcolor get() { return i; }
// -------------------------------------------- //
// OVERRIDE

View File

@ -5,15 +5,15 @@ import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.mcore.util.Txt;
public class ChatTagFactionRole extends ChatTagAbstract
public class ChatTagRole extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionRole() { super("factions_role"); }
private static ChatTagFactionRole i = new ChatTagFactionRole();
public static ChatTagFactionRole get() { return i; }
private ChatTagRole() { super("factions_role"); }
private static ChatTagRole i = new ChatTagRole();
public static ChatTagRole get() { return i; }
// -------------------------------------------- //
// OVERRIDE

View File

@ -4,15 +4,15 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
public class ChatTagFactionRoleprefix extends ChatTagAbstract
public class ChatTagRoleprefix extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionRoleprefix() { super("factions_roleprefix"); }
private static ChatTagFactionRoleprefix i = new ChatTagFactionRoleprefix();
public static ChatTagFactionRoleprefix get() { return i; }
private ChatTagRoleprefix() { super("factions_roleprefix"); }
private static ChatTagRoleprefix i = new ChatTagRoleprefix();
public static ChatTagRoleprefix get() { return i; }
// -------------------------------------------- //
// OVERRIDE

View File

@ -1,26 +0,0 @@
package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.mcore.mixin.Mixin;
public class ChatTagSendee extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagSendee() { super("sendee"); }
private static ChatTagSendee i = new ChatTagSendee();
public static ChatTagSendee get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public String getReplacement(String senderId, String sendeeId, String recipientId)
{
return Mixin.getDisplayName(sendeeId);
}
}

View File

@ -1,26 +0,0 @@
package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.mcore.mixin.Mixin;
public class ChatTagSendeeId extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagSendeeId() { super("sendeeid"); }
private static ChatTagSendeeId i = new ChatTagSendeeId();
public static ChatTagSendeeId get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public String getReplacement(String senderId, String sendeeId, String recipientId)
{
return Mixin.tryFix(sendeeId);
}
}

View File

@ -1,26 +0,0 @@
package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.mcore.mixin.Mixin;
public class ChatTagSender extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagSender() { super("sender"); }
private static ChatTagSender i = new ChatTagSender();
public static ChatTagSender get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public String getReplacement(String senderId, String sendeeId, String recipientId)
{
return Mixin.getDisplayName(senderId);
}
}

View File

@ -1,26 +0,0 @@
package com.massivecraft.factions.chat.tag;
import com.massivecraft.factions.chat.ChatTagAbstract;
import com.massivecraft.mcore.mixin.Mixin;
public class ChatTagSenderId extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagSenderId() { super("senderid"); }
private static ChatTagSenderId i = new ChatTagSenderId();
public static ChatTagSenderId get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public String getReplacement(String senderId, String sendeeId, String recipientId)
{
return Mixin.tryFix(senderId);
}
}

View File

@ -4,15 +4,15 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
public class ChatTagFactionTag extends ChatTagAbstract
public class ChatTagTag extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionTag() { super("factions_tag"); }
private static ChatTagFactionTag i = new ChatTagFactionTag();
public static ChatTagFactionTag get() { return i; }
private ChatTagTag() { super("factions_tag"); }
private static ChatTagTag i = new ChatTagTag();
public static ChatTagTag get() { return i; }
// -------------------------------------------- //
// OVERRIDE

View File

@ -4,15 +4,15 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
public class ChatTagFactionTagforce extends ChatTagAbstract
public class ChatTagTagforce extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionTagforce() { super("factions_tagforce"); }
private static ChatTagFactionTagforce i = new ChatTagFactionTagforce();
public static ChatTagFactionTagforce get() { return i; }
private ChatTagTagforce() { super("factions_tagforce"); }
private static ChatTagTagforce i = new ChatTagTagforce();
public static ChatTagTagforce get() { return i; }
// -------------------------------------------- //
// OVERRIDE

View File

@ -4,15 +4,15 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayerColl;
import com.massivecraft.factions.chat.ChatTagAbstract;
public class ChatTagFactionTitle extends ChatTagAbstract
public class ChatTagTitle extends ChatTagAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private ChatTagFactionTitle() { super("factions_title"); }
private static ChatTagFactionTitle i = new ChatTagFactionTitle();
public static ChatTagFactionTitle get() { return i; }
private ChatTagTitle() { super("factions_title"); }
private static ChatTagTitle i = new ChatTagTitle();
public static ChatTagTitle get() { return i; }
// -------------------------------------------- //
// OVERRIDE