Added another hook, handleFactionTagExternally, for chat plugins to indicate they're handling faction tag insertion into chat
This commit is contained in:
		@@ -45,6 +45,7 @@ public class Conf {
 | 
			
		||||
	// Configuration on the Faction tag in chat messages.
 | 
			
		||||
	public static boolean preloadChatPlugins = true;
 | 
			
		||||
	public static boolean chatTagEnabled = true;
 | 
			
		||||
	public static transient boolean chatTagHandledByAnotherPlugin = false;
 | 
			
		||||
	public static boolean chatTagRelationColored = true;
 | 
			
		||||
	public static String chatTagReplaceString = "{FACTION}";
 | 
			
		||||
	public static String chatTagInsertAfterString = "";
 | 
			
		||||
 
 | 
			
		||||
@@ -209,6 +209,11 @@ public class Factions extends JavaPlugin {
 | 
			
		||||
		return me.isFactionChatting();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// If another plugin is handling insertion of chat tags, this should be used to notify Factions
 | 
			
		||||
	public static void handleFactionTagExternally(boolean notByFactions) {
 | 
			
		||||
		Conf.chatTagHandledByAnotherPlugin = notByFactions;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Get a player's faction tag (faction name), mainly for usage by chat plugins for local/channel chat
 | 
			
		||||
	public static String getPlayerFactionTag(Player player) {
 | 
			
		||||
		return getPlayerFactionTagRelation(player, null);
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@ public class FactionsPlayerListener extends PlayerListener{
 | 
			
		||||
		
 | 
			
		||||
		// Are we to insert the Faction tag into the format?
 | 
			
		||||
		// If we are not to insert it - we are done.
 | 
			
		||||
		if ( ! Conf.chatTagEnabled) {
 | 
			
		||||
		if ( ! Conf.chatTagEnabled || Conf.chatTagHandledByAnotherPlugin) {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user