Skip to content

Commit

Permalink
Fix permission for receiving channel broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
RappyTV committed Nov 5, 2024
1 parent 94a375e commit 204cf85
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import net.kyori.adventure.text.serializer.json.JSONComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand All @@ -22,7 +21,6 @@
import org.jetbrains.annotations.NotNull;

import java.io.*;
import java.util.UUID;

@SuppressWarnings("ConstantConditions")
public class PlayerChatListener implements Listener, ChatRenderer, PluginMessageListener {
Expand Down Expand Up @@ -179,7 +177,7 @@ private void broadcastChannelMessage(Player sender, String channel, String compo
String permission = section.getString("permission");
Component message = JSONComponentSerializer.json().deserialize(component);
for(Player target : Bukkit.getOnlinePlayers()) {
if(Permissions.hasExactPermission(target, "simplechat.chat.*") || Permissions.hasExactPermission(target, permission))
if(Permissions.hasExactPermission(target, "simplechat.channel.*") || Permissions.hasExactPermission(target, permission))
target.sendMessage(message);
}
plugin.getServer().getConsoleSender().sendMessage(message);
Expand Down

0 comments on commit 204cf85

Please sign in to comment.