diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar index 22ed811..fee5ae5 100644 Binary files a/TheButtonAutoFlair.jar and b/TheButtonAutoFlair.jar differ diff --git a/TheButtonAutoFlair/plugin.yml b/TheButtonAutoFlair/plugin.yml index 49ed0b5..4bcf6f7 100644 --- a/TheButtonAutoFlair/plugin.yml +++ b/TheButtonAutoFlair/plugin.yml @@ -23,3 +23,5 @@ depend: [Essentials, Towny, Minigames, Votifier, Factions] permissions: tbmc.admin: description: Gives access to /un- commands and /u admin commands + tbmc.rainbow: + description: Gives access to rainbow colors (/u c). diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java index e39fcf4..509d217 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/Commands.java @@ -175,7 +175,7 @@ public class Commands implements CommandExecutor { DoKittyCannon(player, args); break; case "c": - if (PluginMain.permission.has(player, "tbmc.admin")) + if (PluginMain.permission.has(player, "tbmc.rainbow")) { p.RainbowPresserColorMode = !p.RainbowPresserColorMode; if(p.RainbowPresserColorMode) diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java index 4f4e85a..d70cd46 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java @@ -240,6 +240,21 @@ public class PlayerListener implements Listener { // 2015.07.16. } catch (MalformedURLException e) { } if (player.RainbowPresserColorMode) { + if (item.startsWith(RainbowPresserColors[rpc])) { // Prevent + // words + // being + // equal/starting + // with a + // color + // code + // letter to + // be messed + // up + if (rpc + 1 < RainbowPresserColors.length) + rpc++; + else + rpc = 0; + } formattedmessage = formattedmessage.replace(item, "§" + RainbowPresserColors[rpc] + item); if (rpc + 1 < RainbowPresserColors.length) @@ -380,6 +395,13 @@ public class PlayerListener implements Listener { // 2015.07.16. formattedmessage, (greentext ? "green" : player.CurrentChannel.Color))); // System.out.println(formattedmessage); // TO!DO: TMP + String jsonstr = json.toString(); + if (jsonstr.length() >= 32767) { + event.getPlayer() + .sendMessage( + "§cError: Message too large. Try shortening it, or remove hashtags and other formatting."); + return; + } if (player.CurrentChannel.equals(Channel.TownChat) || player.CurrentChannel.equals(Channel.NationChat)) // for (Resident resident : @@ -835,8 +857,9 @@ public class PlayerListener implements Listener { // 2015.07.16. if (args[0].toLowerCase().equals("enemy") && args[1].equalsIgnoreCase("newhaven")) { event.setCancelled(true); - event.getPlayer().sendMessage( - "§cYou are not allowed to set New Haven as your enemy faction."); + event.getPlayer() + .sendMessage( + "§cYou are not allowed to set New Haven as your enemy faction."); } } } diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/Commands.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/Commands.class index 9db602e..21b5e1f 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/Commands.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/Commands.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$3.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$3.class index 40dc692..0ae59ed 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$3.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$3.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$4.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$4.class index ba8f740..57321d0 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$4.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$4.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class index 0d6043e..d4a207c 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class differ