Skip to content

Commit

Permalink
Added the ability to use colors within island chat (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Apr 30, 2022
1 parent 751aa8f commit b3e9ce8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Expand Up @@ -73,7 +73,7 @@ public void execute(SuperiorSkyblockPlugin plugin, CommandSender sender, String[
}
superiorPlayer.toggleTeamChat();
} else {
String message = CommandArguments.buildLongString(args, 1, true);
String message = CommandArguments.buildLongString(args, 1, superiorPlayer.hasPermissionWithoutOP("superior.chat.color"));
IslandUtils.sendMessage(island, Message.TEAM_CHAT_FORMAT, new ArrayList<>(), superiorPlayer.getPlayerRole(),
superiorPlayer.getName(), message);
Message.SPY_TEAM_CHAT_FORMAT.send(Bukkit.getConsoleSender(), superiorPlayer.getPlayerRole(), superiorPlayer.getName(), message);
Expand Down
Expand Up @@ -355,7 +355,9 @@ public void onPlayerAsyncChat(AsyncPlayerChatEvent e) {

e.setCancelled(true);

EventResult<String> eventResult = plugin.getEventsBus().callIslandChatEvent(island, superiorPlayer, e.getMessage());
EventResult<String> eventResult = plugin.getEventsBus().callIslandChatEvent(island, superiorPlayer,
superiorPlayer.hasPermissionWithoutOP("superior.chat.color") ?
Formatters.COLOR_FORMATTER.format(e.getMessage()) : e.getMessage());

if (eventResult.isCancelled())
return;
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/plugin.yml
Expand Up @@ -327,4 +327,6 @@ permissions:
superior.admin.withdraw:
description: Withdraw money from another player's island bank.
superior.admin.world:
description: Unlock a world for an island.
description: Unlock a world for an island.
superior.chat.color:
description: Gives access to use colors within island chat.

0 comments on commit b3e9ce8

Please sign in to comment.