mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-03 14:38:56 +00:00
v0.51:
- New Permission node: townychat.chat.format.*
- default: op
- Provides the ability to use bold, italics, etc in chat.
- Child nodes:
- townychat.chat.format.bold
- townychat.chat.format.italic
- townychat.chat.format.magic
- townychat.chat.format.undeline
- townychat.chat.format.strike
- New Permission node: townychat.chat.format.reset
- default: everyone
- Provides the ability to reset chat formatting to default using
&r.
This commit is contained in:
1 parent
607890a4fb
commit
6d794e210a
3 files changed
+60
-2
No files matched your search
+15
-1
@@ -200,4 +200,18 @@ v0.49:
|
||||
- Add new chatconfig tags {permgroupprefix}, {permgroupsuffix}, used to show only group prefix and suffixes. Requires Towny 0.91.4.13 or newer to function properly!
|
||||
v0.50:
|
||||
- Chatconfig change: whereas before the tag_formats.both had to be set at [%s, %s], it can now be set to [%t, %n].
|
||||
- Doing so would show the Town tag before the Nation tag, opposite behaviour as before.
|
||||
- Doing so would show the Town tag before the Nation tag, opposite behaviour as before.
|
||||
v0.51:
|
||||
- New Permission node: townychat.chat.format.*
|
||||
- default: op
|
||||
- Provides the ability to use bold, italics, etc in chat.
|
||||
- Child nodes:
|
||||
- townychat.chat.format.bold
|
||||
- townychat.chat.format.italic
|
||||
- townychat.chat.format.magic
|
||||
- townychat.chat.format.undeline
|
||||
- townychat.chat.format.strike
|
||||
- New Permission node: townychat.chat.format.reset
|
||||
- default: everyone
|
||||
- Provides the ability to reset chat formatting to default using &r.
|
||||
|
||||
@@ -161,6 +161,38 @@ public class TownyChatPlayerListener implements Listener {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (event.getMessage().contains("&L") || event.getMessage().contains("&l") ||
|
||||
event.getMessage().contains("&O") || event.getMessage().contains("&o") ||
|
||||
event.getMessage().contains("&N") || event.getMessage().contains("&n") ||
|
||||
event.getMessage().contains("&K") || event.getMessage().contains("&k") ||
|
||||
event.getMessage().contains("&M") || event.getMessage().contains("&m") ||
|
||||
event.getMessage().contains("&R") || event.getMessage().contains("&r") ) {
|
||||
if (!player.hasPermission("townychat.chat.format.bold")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&L", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&l", ""));
|
||||
}
|
||||
if (!player.hasPermission("townychat.chat.format.italic")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&O", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&o", ""));
|
||||
}
|
||||
if (!player.hasPermission("townychat.chat.format.magic")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&K", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&k", ""));
|
||||
}
|
||||
if (!player.hasPermission("townychat.chat.format.underlined")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&N", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&n", ""));
|
||||
}
|
||||
if (!player.hasPermission("townychat.chat.format.strike")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&M", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&m", ""));
|
||||
}
|
||||
if (!player.hasPermission("townychat.chat.format.reset")) {
|
||||
event.setMessage(event.getMessage().replaceAll("&R", ""));
|
||||
event.setMessage(event.getMessage().replaceAll("&r", ""));
|
||||
}
|
||||
}
|
||||
|
||||
if(player.hasPermission("townychat.chat.color"))
|
||||
event.setMessage(ChatColor.translateAlternateColorCodes('&', event.getMessage()));
|
||||
|
||||
|
||||
+13
-1
@@ -1,6 +1,6 @@
|
||||
name: TownyChat
|
||||
main: com.palmergames.bukkit.TownyChat.Chat
|
||||
version: 0.50
|
||||
version: 0.51
|
||||
author: ElgarL, Shade, phrstbrn
|
||||
website: http://towny.palmergames.com/towny/townychat/
|
||||
description: >
|
||||
@@ -60,3 +60,15 @@ permissions:
|
||||
townychat.chat.color:
|
||||
description: Allows players to use colors to format chat messages.
|
||||
default: op
|
||||
townychat.chat.format.*:
|
||||
description: Allows use of all chat format modifiers like bold, italics, etc.
|
||||
default: op
|
||||
children:
|
||||
townychat.chat.format.bold: true
|
||||
townychat.chat.format.italic: true
|
||||
townychat.chat.format.magic: true
|
||||
townychat.chat.format.underline: true
|
||||
townychat.chat.format.strike: true
|
||||
townychat.chat.format.reset:
|
||||
description: Allows the use of &r to reset chat formatting.
|
||||
default: true
|
||||
Reference in new issue
Block a user