public static interface ChannelBinding.RawDataChannel extends ChannelBinding
ChannelBinding.IndexedMessageChannel, ChannelBinding.RawDataChannel
Modifier and Type | Method and Description |
---|---|
void |
addListener(Platform.Type side,
RawDataListener listener)
Adds a listener to this channel that is invoked every time data is
sent to it on the given side.
|
void |
addListener(RawDataListener listener)
Adds a listener to this channel that is invoked every time data is
sent to it on either side.
|
void |
removeListener(RawDataListener listener)
Removes the listener from handling data.
|
void |
sendTo(Player player,
Consumer<ChannelBuf> payload)
Sends the raw payload to the player across this channel.
|
void |
sendToAll(Consumer<ChannelBuf> payload)
Sends the raw payload to all players on the server.
|
void |
sendToServer(Consumer<ChannelBuf> payload)
Sends the raw payload to the server.
|
getName, getOwner, getRegistrar
void addListener(RawDataListener listener)
listener
- The listenervoid addListener(Platform.Type side, RawDataListener listener)
side
- The side to listen to data onlistener
- The listenervoid removeListener(RawDataListener listener)
listener
- The listenervoid sendTo(Player player, Consumer<ChannelBuf> payload)
player
- The player to send the message topayload
- A consumer to write the data tovoid sendToServer(Consumer<ChannelBuf> payload)
payload
- A consumer to write the data tovoid sendToAll(Consumer<ChannelBuf> payload)
payload
- A consumer to write the data to