Added colored text with rainbow colors!
This commit is contained in:
parent
63929b7006
commit
377d6d9035
10 changed files with 34 additions and 2 deletions
Binary file not shown.
|
@ -142,6 +142,7 @@ public class Commands implements CommandExecutor {
|
|||
DoAnnounce(player, args, null);
|
||||
break;
|
||||
case "name":
|
||||
{
|
||||
if (args.length == 1) {
|
||||
player.sendMessage("§cUsage: /u name <playername>§r");
|
||||
break;
|
||||
|
@ -155,6 +156,7 @@ public class Commands implements CommandExecutor {
|
|||
player.sendMessage("§bUsername of " + args[1] + ": "
|
||||
+ mp.UserName);
|
||||
break;
|
||||
}
|
||||
case "enable":
|
||||
if (player.getName().equals("NorbiPeti")) {
|
||||
PlayerListener.Enable = true;
|
||||
|
@ -172,6 +174,18 @@ public class Commands implements CommandExecutor {
|
|||
case "kittycannon":
|
||||
DoKittyCannon(player, args);
|
||||
break;
|
||||
case "c":
|
||||
if (PluginMain.permission.has(player, "tbmc.admin"))
|
||||
{
|
||||
p.RainbowPresserColorMode = !p.RainbowPresserColorMode;
|
||||
if(p.RainbowPresserColorMode)
|
||||
player.sendMessage("§eRainbow colors §aenabled.");
|
||||
else
|
||||
player.sendMessage("§eRainbow colors §cdisabled.");
|
||||
}
|
||||
else
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public class MaybeOfflinePlayer {
|
|||
public int FCount;
|
||||
public boolean SendingLink = false;
|
||||
public int FDeaths;
|
||||
public boolean RainbowPresserColorMode = false;
|
||||
|
||||
public UUID UUID;
|
||||
|
||||
|
|
|
@ -209,12 +209,20 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
|||
// slashes
|
||||
// first
|
||||
formattedmessage = formattedmessage.replace("\"", "\\\"");
|
||||
if (PluginMain.permission.has(event.getPlayer(), "tbmc.admin")) {
|
||||
formattedmessage = formattedmessage.replace("&", "§");
|
||||
formattedmessage = formattedmessage.replace("§r", "§"
|
||||
+ player.CurrentChannel.DisplayName.charAt(1));
|
||||
}
|
||||
String suggestmsg = formattedmessage;
|
||||
|
||||
// URLs
|
||||
// URLs + Rainbow text
|
||||
String[] parts = formattedmessage.split("\\s+");
|
||||
boolean hadurls = false;
|
||||
for (String item : parts)
|
||||
final String[] RainbowPresserColors = new String[] { "c", "6", "e",
|
||||
"a", "9", "5" };
|
||||
int rpc = 0;
|
||||
for (String item : parts) {
|
||||
try {
|
||||
URL url = new URL(item);
|
||||
formattedmessage = formattedmessage
|
||||
|
@ -231,6 +239,15 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
|||
// System.out.println("URL: " + url);
|
||||
} catch (MalformedURLException e) {
|
||||
}
|
||||
if (player.RainbowPresserColorMode) {
|
||||
formattedmessage = formattedmessage.replace(item, "§"
|
||||
+ RainbowPresserColors[rpc] + item);
|
||||
if (rpc + 1 < RainbowPresserColors.length)
|
||||
rpc++;
|
||||
else
|
||||
rpc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hadurls) {
|
||||
for (Player p : PluginMain.GetPlayers()) { // 2015.08.12.
|
||||
|
|
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