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);
|
DoAnnounce(player, args, null);
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
|
{
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
player.sendMessage("§cUsage: /u name <playername>§r");
|
player.sendMessage("§cUsage: /u name <playername>§r");
|
||||||
break;
|
break;
|
||||||
|
@ -155,6 +156,7 @@ public class Commands implements CommandExecutor {
|
||||||
player.sendMessage("§bUsername of " + args[1] + ": "
|
player.sendMessage("§bUsername of " + args[1] + ": "
|
||||||
+ mp.UserName);
|
+ mp.UserName);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case "enable":
|
case "enable":
|
||||||
if (player.getName().equals("NorbiPeti")) {
|
if (player.getName().equals("NorbiPeti")) {
|
||||||
PlayerListener.Enable = true;
|
PlayerListener.Enable = true;
|
||||||
|
@ -172,6 +174,18 @@ public class Commands implements CommandExecutor {
|
||||||
case "kittycannon":
|
case "kittycannon":
|
||||||
DoKittyCannon(player, args);
|
DoKittyCannon(player, args);
|
||||||
break;
|
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:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class MaybeOfflinePlayer {
|
||||||
public int FCount;
|
public int FCount;
|
||||||
public boolean SendingLink = false;
|
public boolean SendingLink = false;
|
||||||
public int FDeaths;
|
public int FDeaths;
|
||||||
|
public boolean RainbowPresserColorMode = false;
|
||||||
|
|
||||||
public UUID UUID;
|
public UUID UUID;
|
||||||
|
|
||||||
|
|
|
@ -209,12 +209,20 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
// slashes
|
// slashes
|
||||||
// first
|
// first
|
||||||
formattedmessage = formattedmessage.replace("\"", "\\\"");
|
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;
|
String suggestmsg = formattedmessage;
|
||||||
|
|
||||||
// URLs
|
// URLs + Rainbow text
|
||||||
String[] parts = formattedmessage.split("\\s+");
|
String[] parts = formattedmessage.split("\\s+");
|
||||||
boolean hadurls = false;
|
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 {
|
try {
|
||||||
URL url = new URL(item);
|
URL url = new URL(item);
|
||||||
formattedmessage = formattedmessage
|
formattedmessage = formattedmessage
|
||||||
|
@ -231,6 +239,15 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
// System.out.println("URL: " + url);
|
// System.out.println("URL: " + url);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
}
|
}
|
||||||
|
if (player.RainbowPresserColorMode) {
|
||||||
|
formattedmessage = formattedmessage.replace(item, "§"
|
||||||
|
+ RainbowPresserColors[rpc] + item);
|
||||||
|
if (rpc + 1 < RainbowPresserColors.length)
|
||||||
|
rpc++;
|
||||||
|
else
|
||||||
|
rpc = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!hadurls) {
|
if (!hadurls) {
|
||||||
for (Player p : PluginMain.GetPlayers()) { // 2015.08.12.
|
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