Class Channel
java.lang.Object
me.hsgamer.hscore.bungeecord.channel.Channel
The base channel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Get the channel's namenet.md_5.bungee.api.plugin.PluginGet the plugin providing the channelabstract voidhandleMessage(net.md_5.bungee.api.event.PluginMessageEvent event) Handle the received data from plugin messagingvoidregister()Register the channelvoidsend(net.md_5.bungee.api.config.ServerInfo server, byte[] data) Send the data to a servervoidsend(net.md_5.bungee.api.connection.ProxiedPlayer player, byte[] data) Send the data to a playervoidsendAll(byte[] data) Send the data to all serversvoidsendAll(byte[] data, boolean hasPlayer) Send the data to all serversvoidUnregister the channel
-
Constructor Details
-
Channel
Create a new channel- Parameters:
name- the channel nameplugin- the plugin
-
-
Method Details
-
register
public void register()Register the channel -
unregister
public void unregister()Unregister the channel -
handleMessage
public abstract void handleMessage(net.md_5.bungee.api.event.PluginMessageEvent event) Handle the received data from plugin messaging- Parameters:
event- the plugin message event
-
sendAll
public void sendAll(byte[] data) Send the data to all servers- Parameters:
data- the data
-
sendAll
public void sendAll(byte[] data, boolean hasPlayer) Send the data to all servers- Parameters:
data- the datahasPlayer- check if the server has players
-
send
public void send(net.md_5.bungee.api.config.ServerInfo server, byte[] data) Send the data to a server- Parameters:
server- the serverdata- the data
-
send
public void send(net.md_5.bungee.api.connection.ProxiedPlayer player, byte[] data) Send the data to a player- Parameters:
player- the playerdata- the data
-
getName
Get the channel's name- Returns:
- the name
-
getPlugin
public net.md_5.bungee.api.plugin.Plugin getPlugin()Get the plugin providing the channel- Returns:
- the plugin
-