Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Add ignore-chat-cancel option
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed May 20, 2014
1 parent 13a596d commit 4c69c29
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 2 additions & 0 deletions pom.xml
Expand Up @@ -128,6 +128,8 @@
<version>2.11.4</version>
</dependency>

<!-- Old Factions -->

<!-- Factions -->
<dependency>
<groupId>com.massivecraft</groupId>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/cnaude/purpleirc/ChannelWatcher.java
@@ -1,7 +1,6 @@
package com.cnaude.purpleirc;

import org.bukkit.scheduler.BukkitTask;
import org.pircbotx.Channel;

/**
*
Expand Down
Expand Up @@ -37,7 +37,7 @@ public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
return;
}
event.setMessage(message.replace("[[townytag]]", ""));
if (event.isCancelled() && !plugin.isPluginEnabled("FactionChat")) {
if (event.isCancelled() && !plugin.isPluginEnabled("FactionChat") && !plugin.ignoreChatCancel) {
plugin.logDebug("Ignore chat message due to event cancellation: " + event.getMessage());
return;
}
Expand Down
@@ -1,7 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.cnaude.purpleirc.Hooks;

import com.cnaude.purpleirc.PurpleIRC;
Expand Down Expand Up @@ -31,6 +27,7 @@ public FactionChatHook(PurpleIRC plugin) {
*/
public String getChatMode(Player player) {
String playerChatMode = null;

try {
playerChatMode = FactionChatAPI.getChatMode(player);
plugin.logDebug("fcHook => [CM: " + playerChatMode + "] [" + player.getName() + "]");
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/cnaude/purpleirc/PurpleIRC.java
Expand Up @@ -116,6 +116,7 @@ public class PurpleIRC extends JavaPlugin {
private boolean customTabList;
private boolean listSortByName;
public boolean exactNickMatch;
public boolean ignoreChatCancel;
public Long ircConnCheckInterval;
public Long ircChannelCheckInterval;
public ChannelWatcher channelWatcher;
Expand Down Expand Up @@ -523,6 +524,7 @@ private void loadConfig() {
stripIRCColors = getConfig().getBoolean("strip-irc-colors", false);
stripIRCBackgroundColors = getConfig().getBoolean("strip-irc-bg-colors", true);
exactNickMatch = getConfig().getBoolean("nick-exact-match", true);
ignoreChatCancel = getConfig().getBoolean("ignore-chat-cancel", false);
colorConverter = new ColorConverter(this, stripGameColors, stripIRCColors, stripIRCBackgroundColors);
logDebug("strip-game-colors: " + stripGameColors);
logDebug("strip-irc-colors: " + stripIRCColors);
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/com/cnaude/purpleirc/Utilities/RegexGlobber.java
@@ -1,17 +1,12 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.cnaude.purpleirc.Utilities;

/**
/** http://stackoverflow.com/questions/1247772/is-there-an-equivalent-of-java-util-regex-for-glob-type-patterns
*
* @author cnaude
*/
public class RegexGlobber {
//http://stackoverflow.com/questions/1247772/is-there-an-equivalent-of-java-util-regex-for-glob-type-patterns
public class RegexGlobber {

/**
/**
*
* @param glob
* @return
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Expand Up @@ -214,3 +214,5 @@ game-color-map:
WHITE: WHITE
YELLOW: YELLOW
Debug: false
# Ignore chat cancellation.
ignore-chat-cancel: false

0 comments on commit 4c69c29

Please sign in to comment.