Fix color codes in greeting/farewell messages.

Fixes WORLDGUARD-3319.
This commit is contained in:
sk89q 2015-01-19 11:17:06 -08:00
parent 91353d6b01
commit 8073945af0
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,7 @@
package com.sk89q.worldguard.session.handler;
import com.google.common.collect.Sets;
import com.sk89q.worldguard.bukkit.commands.CommandUtils;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.flags.DefaultFlag;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
@ -65,7 +66,9 @@ public boolean onCrossBoundary(Player player, Location from, Location to, Applic
for (String message : lastMessageStack) {
if (!messages.contains(message)) {
player.sendMessage(getPlugin().replaceMacros(player, message).replaceAll("\\\\n", "\n").split("\\n"));
String effective = CommandUtils.replaceColorMacros(message);
effective = getPlugin().replaceMacros(player, effective);
player.sendMessage(effective.replaceAll("\\\\n", "\n").split("\\n"));
break;
}
}

View File

@ -20,6 +20,7 @@
package com.sk89q.worldguard.session.handler;
import com.google.common.collect.Sets;
import com.sk89q.worldguard.bukkit.commands.CommandUtils;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.flags.DefaultFlag;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
@ -46,7 +47,9 @@ public boolean onCrossBoundary(Player player, Location from, Location to, Applic
for (String message : messages) {
if (!lastMessageStack.contains(message)) {
player.sendMessage(getPlugin().replaceMacros(player, message).replaceAll("\\\\n", "\n").split("\\n"));
String effective = CommandUtils.replaceColorMacros(message);
effective = getPlugin().replaceMacros(player, effective);
player.sendMessage(effective.replaceAll("\\\\n", "\n").split("\\n"));
break;
}
}