Fixed /u <color> confirm message and rainbow colors
This commit is contained in:
parent
15c6a57979
commit
37ba5a5d5f
10 changed files with 8 additions and 4 deletions
Binary file not shown.
|
@ -191,8 +191,9 @@ public class Commands implements CommandExecutor {
|
|||
p.RainbowPresserColorMode = false;
|
||||
p.OtherColorMode = Short.parseShort(args[1], 16);
|
||||
if (p.OtherColorMode != 0xFF)
|
||||
player.sendMessage("§eMessage color set to §"
|
||||
+ p.OtherColorMode + p.OtherColorMode);
|
||||
player.sendMessage(String.format(
|
||||
"§eMessage color set to §%x%x",
|
||||
p.OtherColorMode, p.OtherColorMode));
|
||||
else
|
||||
player.sendMessage("§eMessage color reset.");
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Random;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -255,8 +256,10 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
|||
else
|
||||
rpc = 0;
|
||||
}
|
||||
formattedmessage = formattedmessage.replace(item, "§"
|
||||
+ RainbowPresserColors[rpc] + item);
|
||||
formattedmessage = formattedmessage.replaceFirst(
|
||||
"(?i)" + Pattern.quote(item),
|
||||
Matcher.quoteReplacement("§"
|
||||
+ RainbowPresserColors[rpc] + item));
|
||||
if (rpc + 1 < RainbowPresserColors.length)
|
||||
rpc++;
|
||||
else
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue