Fixed certain messages kicking players, fixed rainbow chat, added tbmc.rainbow permission
This commit is contained in:
parent
2007001562
commit
6d573a0d68
8 changed files with 28 additions and 3 deletions
Binary file not shown.
|
@ -23,3 +23,5 @@ depend: [Essentials, Towny, Minigames, Votifier, Factions]
|
||||||
permissions:
|
permissions:
|
||||||
tbmc.admin:
|
tbmc.admin:
|
||||||
description: Gives access to /un- commands and /u admin commands
|
description: Gives access to /un- commands and /u admin commands
|
||||||
|
tbmc.rainbow:
|
||||||
|
description: Gives access to rainbow colors (/u c).
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class Commands implements CommandExecutor {
|
||||||
DoKittyCannon(player, args);
|
DoKittyCannon(player, args);
|
||||||
break;
|
break;
|
||||||
case "c":
|
case "c":
|
||||||
if (PluginMain.permission.has(player, "tbmc.admin"))
|
if (PluginMain.permission.has(player, "tbmc.rainbow"))
|
||||||
{
|
{
|
||||||
p.RainbowPresserColorMode = !p.RainbowPresserColorMode;
|
p.RainbowPresserColorMode = !p.RainbowPresserColorMode;
|
||||||
if(p.RainbowPresserColorMode)
|
if(p.RainbowPresserColorMode)
|
||||||
|
|
|
@ -240,6 +240,21 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
}
|
}
|
||||||
if (player.RainbowPresserColorMode) {
|
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, "§"
|
formattedmessage = formattedmessage.replace(item, "§"
|
||||||
+ RainbowPresserColors[rpc] + item);
|
+ RainbowPresserColors[rpc] + item);
|
||||||
if (rpc + 1 < RainbowPresserColors.length)
|
if (rpc + 1 < RainbowPresserColors.length)
|
||||||
|
@ -380,6 +395,13 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
formattedmessage, (greentext ? "green"
|
formattedmessage, (greentext ? "green"
|
||||||
: player.CurrentChannel.Color)));
|
: player.CurrentChannel.Color)));
|
||||||
// System.out.println(formattedmessage); // TO!DO: TMP
|
// 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)
|
if (player.CurrentChannel.equals(Channel.TownChat)
|
||||||
|| player.CurrentChannel.equals(Channel.NationChat))
|
|| player.CurrentChannel.equals(Channel.NationChat))
|
||||||
// for (Resident resident :
|
// for (Resident resident :
|
||||||
|
@ -835,8 +857,9 @@ public class PlayerListener implements Listener { // 2015.07.16.
|
||||||
if (args[0].toLowerCase().equals("enemy")
|
if (args[0].toLowerCase().equals("enemy")
|
||||||
&& args[1].equalsIgnoreCase("newhaven")) {
|
&& args[1].equalsIgnoreCase("newhaven")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.getPlayer().sendMessage(
|
event.getPlayer()
|
||||||
"§cYou are not allowed to set New Haven as your enemy faction.");
|
.sendMessage(
|
||||||
|
"§cYou are not allowed to set New Haven as your enemy faction.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue