mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 22:21:52 +00:00
Add permission to use colored chat messages
This commit is contained in:
1 parent
3f8ca2cef2
commit
f8c88259a0
2 files changed
+7
No files matched your search
@@ -2,6 +2,7 @@ package com.palmergames.bukkit.TownyChat.listener;
|
|||||||
|
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@@ -160,6 +161,9 @@ public class TownyChatPlayerListener implements Listener {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if(player.hasPermission("townychat.chat.color"))
|
||||||
|
event.setMessage(ChatColor.translateAlternateColorCodes('&', event.getMessage()));
|
||||||
|
|
||||||
// Check if essentials has this player muted.
|
// Check if essentials has this player muted.
|
||||||
if (!isMuted(player)) {
|
if (!isMuted(player)) {
|
||||||
|
|
||||||
|
|||||||
@@ -57,3 +57,6 @@ permissions:
|
|||||||
townychat.mod.unmute:
|
townychat.mod.unmute:
|
||||||
description: Allows mods access to the unmute command to remove a previous mute.
|
description: Allows mods access to the unmute command to remove a previous mute.
|
||||||
default: op
|
default: op
|
||||||
|
townychat.chat.color:
|
||||||
|
description: Allows players to use colors to format chat messages.
|
||||||
|
default: op
|
||||||
Reference in new issue
Block a user