Skip to content

Commit

Permalink
Potential reset code. hacky
Browse files Browse the repository at this point in the history
  • Loading branch information
mbax committed Dec 2, 2012
1 parent 68de281 commit cdb1c1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.yml
Expand Up @@ -284,6 +284,7 @@ colormap:
- {irc: 13, game: "\u00A7d", name: 'magenta'}
- {irc: 8, game: "\u00A7e", name: 'yellow'}
- {irc: 1, game: "\u00A7f", name: 'foreground'}
- {irc: -1, game: "\u00Afr", name: 'reset'}


# ******************* REPLACEMENT FILTERS *******************
Expand Down
4 changes: 3 additions & 1 deletion src/com/ensifera/animosity/craftirc/CraftIRC.java
Expand Up @@ -20,6 +20,7 @@

import com.ensifera.animosity.craftirc.libs.com.sk89q.util.config.Configuration;
import com.ensifera.animosity.craftirc.libs.com.sk89q.util.config.ConfigurationNode;
import com.ensifera.animosity.craftirc.libs.org.jibble.pircbot.Colors;

/**
* @author Animosity
Expand Down Expand Up @@ -881,7 +882,8 @@ public String colorizeName(String name) {
final Pattern color_codes = Pattern.compile(ChatColor.COLOR_CHAR + "[0-9a-fk-r]");
Matcher find_colors = color_codes.matcher(name);
while (find_colors.find()) {
name = find_colors.replaceFirst(Character.toString((char) 3) + this.cColorIrcFromGame(find_colors.group()));
String color = this.cColorIrcFromGame(find_colors.group());
name = find_colors.replaceFirst(color.equals("-1") ? Colors.NORMAL: Character.toString((char) 3) + color);
find_colors = color_codes.matcher(name);
}
return name;
Expand Down

0 comments on commit cdb1c1b

Please sign in to comment.