Package me.hsgamer.hscore.bukkit.channel
Class BungeeSubChannel
java.lang.Object
me.hsgamer.hscore.bukkit.channel.Channel
me.hsgamer.hscore.bukkit.channel.BungeeSubChannel
- All Implemented Interfaces:
org.bukkit.plugin.messaging.PluginMessageListener
The sub-channel for the main BungeeCord channel
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
BungeeSubChannel
(String subChannel, org.bukkit.plugin.Plugin plugin) Create a new sub-channel -
Method Summary
Modifier and TypeMethodDescriptionGet the sub-channel namevoid
handleMessage
(org.bukkit.entity.Player player, byte[] data) Handle the received data from plugin messagingabstract void
handleSubChannelMessage
(org.bukkit.entity.Player player, byte[] data) Handle the received data from plugin messaging through sub-channelvoid
send
(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data) Send the data via the sub-channel with the recipientvoid
sendForward
(String toServer, byte[] data) Forward the data to other serversvoid
sendForward
(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String toServer, byte[] data) Forward the data to other serversMethods inherited from class me.hsgamer.hscore.bukkit.channel.Channel
getName, getPlugin, onPluginMessageReceived, register, send, unregister
-
Field Details
-
logger
The logger for ease
-
-
Constructor Details
-
BungeeSubChannel
Create a new sub-channel- Parameters:
subChannel
- the sub-channel nameplugin
- the plugin
-
-
Method Details
-
getSubChannel
Get the sub-channel name- Returns:
- the sub-channel name
-
sendForward
public void sendForward(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String toServer, byte[] data) Forward the data to other servers- Parameters:
recipient
- the recipienttoServer
- the server to forwarddata
- the data
-
sendForward
Forward the data to other servers- Parameters:
toServer
- the server to forwarddata
- the data
-
handleSubChannelMessage
public abstract void handleSubChannelMessage(org.bukkit.entity.Player player, byte[] data) Handle the received data from plugin messaging through sub-channel- Parameters:
player
- the player involveddata
- the data
-
handleMessage
public void handleMessage(org.bukkit.entity.Player player, byte[] data) Description copied from class:Channel
Handle the received data from plugin messaging- Specified by:
handleMessage
in classChannel
- Parameters:
player
- the player involveddata
- the data
-
send
public void send(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data) Send the data via the sub-channel with the recipient
-