Skip to content

Commit

Permalink
[Feature] Add option to disable TabbedList Formatting (mchat.alter.li…
Browse files Browse the repository at this point in the history
…st).
  • Loading branch information
MiracleM4n committed Sep 8, 2014
1 parent e14457c commit eb330f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@
<name>MChat</name>
<artifactId>MChat</artifactId>
<packaging>jar</packaging>
<version>1.7.9-R0.4-SNAPSHOT</version>
<version>1.7.9-R0.5-SNAPSHOT</version>
<url>https://github.com/Q0rDev/MChat</url>
<description>Chat Formatting for Bukkit</description>

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ca/q0r/mchat/events/bukkit/ChatListener.java
Expand Up @@ -37,7 +37,9 @@ public void onPlayerChat(AsyncPlayerChatEvent event) {
return;
}

setListName(player);
if (ConfigType.MCHAT_ALTER_LIST.getBoolean()) {
setListName(player);
}

// Chat Distance Stuff
if (ConfigType.MCHAT_CHAT_DISTANCE.getDouble() > 0) {
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/ca/q0r/mchat/events/bukkit/PlayerListener.java
Expand Up @@ -58,11 +58,14 @@ public void run() {
}
}

plugin.getServer().getScheduler().runTaskLater(plugin, new BukkitRunnable() {
public void run() {
setListName(player);
}
}, 20L);

if (ConfigType.MCHAT_ALTER_LIST.getBoolean()) {
plugin.getServer().getScheduler().runTaskLater(plugin, new BukkitRunnable() {
public void run() {
setListName(player);
}
}, 20L);
}

if (ConfigType.MCHAT_ALTER_EVENTS.getBoolean()) {
if (ConfigType.SUPPRESS_USE_JOIN.getBoolean()) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ca/q0r/mchat/yml/config/ConfigType.java
Expand Up @@ -20,6 +20,9 @@ public enum ConfigType {
/**
* Whether or not to Alter Events.
*/MCHAT_ALTER_EVENTS("mchat.alter.events"),
/**
* Whether or not to Alter Tabbed List.
*/MCHAT_ALTER_LIST("mchat.alter.list"),
/**
* Distance Based Chat Value. Negative or 0 disables.
*/MCHAT_CHAT_DISTANCE("mchat.chatDistance"),
Expand Down
1 change: 1 addition & 0 deletions src/main/java/ca/q0r/mchat/yml/config/ConfigYml.java
Expand Up @@ -40,6 +40,7 @@ public void loadDefaults() {
checkOption("mchat.apiOnly", false);
checkOption("mchat.updateCheck", true);
checkOption("mchat.alter.events", true);
checkOption("mchat.alter.list", true);
checkOption("mchat.chatDistance", -1.0);
checkOption("mchat.varIndicator", "+");
checkOption("mchat.cusVarIndicator", "-");
Expand Down

0 comments on commit eb330f6

Please sign in to comment.