mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Add .see permission, notify LP of channel perms
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -56,6 +56,7 @@ import net.draycia.carbon.common.messages.CarbonMessageService;
|
|||||||
import net.kyori.adventure.audience.MessageType;
|
import net.kyori.adventure.audience.MessageType;
|
||||||
import net.kyori.adventure.identity.Identity;
|
import net.kyori.adventure.identity.Identity;
|
||||||
import net.kyori.adventure.key.Key;
|
import net.kyori.adventure.key.Key;
|
||||||
|
import net.kyori.adventure.permission.PermissionChecker;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.registry.DefaultedRegistry;
|
import net.kyori.registry.DefaultedRegistry;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -281,6 +282,13 @@ public class CarbonChannelRegistry implements ChannelRegistry, DefaultedRegistry
|
|||||||
|
|
||||||
if (channel instanceof ConfigChatChannel chatChannel) {
|
if (channel instanceof ConfigChatChannel chatChannel) {
|
||||||
builder = builder.permission(chatChannel.permission());
|
builder = builder.permission(chatChannel.permission());
|
||||||
|
|
||||||
|
// Add to LuckPerms permission suggestions... lol
|
||||||
|
this.carbonChat.server().console().get(PermissionChecker.POINTER).ifPresent(checker -> {
|
||||||
|
checker.test(chatChannel.permission());
|
||||||
|
checker.test(chatChannel.permission() + ".see");
|
||||||
|
checker.test(chatChannel.permission() + ".speak");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final var command = builder.senderType(PlayerCommander.class)
|
final var command = builder.senderType(PlayerCommander.class)
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public final class ConfigChatChannel implements ChatChannel {
|
|||||||
return ChannelPermissionResult.allowed();
|
return ChannelPermissionResult.allowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permission.get().test(this.permission())) {
|
if (permission.get().test(this.permission() + ".see")) {
|
||||||
return ChannelPermissionResult.allowed();
|
return ChannelPermissionResult.allowed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user