This repository was archived by the owner on Aug 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathChannel.java
More file actions
73 lines (61 loc) · 2.17 KB
/
Channel.java
File metadata and controls
73 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.github.rmsy.channels;
import com.google.common.collect.ImmutableSet;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import javax.annotation.Nullable;
/** Interface to represent a chat channel. */
public interface Channel {
/**
* Creates the channel's format.
*
* @param message the message.
* @param sender the sender, null if console.
* @param receiver the receiver.
* @param broadcast whether this is a broadcast.
* @return the formatted component.
*/
BaseComponent getFormat(final BaseComponent message, @Nullable final Player sender, final CommandSender receiver, boolean broadcast);
/**
* Gets the users who are sending to this channel by default.
*
* @return The users who are sending to this channel by default.
*/
ImmutableSet<String> getMembers();
/**
* Sends a new message to the channel.
*
* @param message The message to be sent.
* @param sender The message sender, or null for console.
* @return Whether or not the message was sent.
*/
boolean sendMessage(final BaseComponent message, @Nullable final Player sender);
/**
* Sends a new message to the channel.
*
* @param message The message to be sent.
* @param sender The message sender, or null for console.
* @return Whether or not the message was sent.
*/
boolean sendMessage(String message, @Nullable final Player sender);
/**
* Gets the permission node that is required for listening on this channel. Users without this permission node will
* not receive messages from this channel.
*
* @return The permission node that is required for listening on this channel.
*/
Permission getListeningPermission();
/**
* Broadcasts a message to the channel.
*
* @param message The message to be broadcast.
*/
void broadcast(final BaseComponent message);
/**
* Broadcasts a message to the channel.
*
* @param message The message to be broadcast.
*/
void broadcast(String message);
}