Extract channel prefix check to CarbonPlayer

This commit is contained in:
Draycia committed 2023-05-28 17:48:08 -07:00
1 parent d452106e0b
commit 76e3b68dfe
4 files changed
+45

No files matched your search

@@ -154,6 +154,10 @@ public interface CarbonPlayer extends Audience, Identified {
*/
void selectedChannel(final @Nullable ChatChannel chatChannel);
ChannelMessage channelForMessage(final Component message);
record ChannelMessage(Component message, @Nullable ChatChannel channel) {}
/**
* Checks if the player has the specified permission.
*
@@ -355,4 +359,5 @@ public interface CarbonPlayer extends Audience, Identified {
* @since 2.1.0
*/
void leaveChannel(final ChatChannel channel);
}
@@ -90,6 +90,11 @@ class EmptyCarbonPlayer implements CarbonPlayer {
}
@Override
public ChannelMessage channelForMessage(final Component message) {
return new ChannelMessage(message, null);
}
@Override
public boolean hasPermission(final String permission) {
return false;