Package me.hsgamer.hscore.bukkit.channel
Class BungeeUtils
java.lang.Object
me.hsgamer.hscore.bukkit.channel.BungeeUtils
Methods for BungeeCord communication
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The data output consumer -
Method Summary
Modifier and TypeMethodDescriptionstatic void
connectOtherToServer
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String playerName, String server) Connect the player to the serverstatic void
connectToServer
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String server) Connect the recipient to the serverstatic void
forward
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String server, String channel, byte[] data) Forward the data to the serverstatic void
forwardToPlayer
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String channel, byte[] data) Forward the data to the playerstatic byte[]
getDataBytes
(BungeeUtils.DataOutputConsumer dataOutputConsumer) Build the data byte arraystatic org.bukkit.plugin.messaging.PluginMessageRecipient
Get the global plugin message recipientstatic Consumer<IOException>
Get theIOException
consumerstatic void
kickPlayer
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Kick the playerstatic void
register
(org.bukkit.plugin.Plugin plugin) Register the BungeeCord main channel to the pluginstatic void
Register the channel to the pluginstatic void
sendMessage
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Send the message to the playerstatic void
sendPluginMessage
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data) Send the data to the BungeeCord main channelstatic void
sendPluginMessage
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String channel, byte[] data) Send the data to the channelstatic void
sendRawMessage
(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Send the raw message to the playerstatic void
setIoExceptionConsumer
(Consumer<IOException> ioExceptionConsumer) Set theIOException
consumerstatic void
unregister
(org.bukkit.plugin.Plugin plugin) Unregister the BungeeCord main channel from the pluginstatic void
unregister
(org.bukkit.plugin.Plugin plugin, String channel) Unregister the channel from the plugin
-
Method Details
-
getIoExceptionConsumer
Get theIOException
consumer- Returns:
- the consumer
-
setIoExceptionConsumer
Set theIOException
consumer- Parameters:
ioExceptionConsumer
- the consumer
-
getGlobalRecipient
public static org.bukkit.plugin.messaging.PluginMessageRecipient getGlobalRecipient()Get the global plugin message recipient- Returns:
- the global plugin message recipient
-
getDataBytes
Build the data byte array- Parameters:
dataOutputConsumer
- the consumer to build the data byte array- Returns:
- the data byte array
-
register
Register the channel to the plugin- Parameters:
plugin
- the pluginchannel
- the channel
-
unregister
Unregister the channel from the plugin- Parameters:
plugin
- the pluginchannel
- the channel
-
register
public static void register(org.bukkit.plugin.Plugin plugin) Register the BungeeCord main channel to the plugin- Parameters:
plugin
- the plugin
-
unregister
public static void unregister(org.bukkit.plugin.Plugin plugin) Unregister the BungeeCord main channel from the plugin- Parameters:
plugin
- the plugin
-
sendPluginMessage
public static void sendPluginMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String channel, byte[] data) Send the data to the channel- Parameters:
plugin
- the pluginrecipient
- the recipientchannel
- the channeldata
- the data
-
sendPluginMessage
public static void sendPluginMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data) Send the data to the BungeeCord main channel- Parameters:
plugin
- the pluginrecipient
- the recipientdata
- the data
-
connectToServer
public static void connectToServer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String server) Connect the recipient to the server- Parameters:
plugin
- the pluginrecipient
- the recipientserver
- the server
-
connectOtherToServer
public static void connectOtherToServer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String playerName, String server) Connect the player to the server- Parameters:
plugin
- the pluginrecipient
- the recipientplayerName
- the player nameserver
- the server
-
sendMessage
public static void sendMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Send the message to the player- Parameters:
plugin
- the pluginrecipient
- the recipientplayer
- the playermessage
- the message
-
sendRawMessage
public static void sendRawMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Send the raw message to the player- Parameters:
plugin
- the pluginrecipient
- the recipientplayer
- the playermessage
- the message
-
forward
public static void forward(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String server, String channel, byte[] data) Forward the data to the server- Parameters:
plugin
- the pluginrecipient
- the recipientserver
- the serverchannel
- the channeldata
- the data
-
forwardToPlayer
public static void forwardToPlayer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String channel, byte[] data) Forward the data to the player- Parameters:
plugin
- the pluginrecipient
- the recipientplayer
- the playerchannel
- the channeldata
- the data
-
kickPlayer
public static void kickPlayer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message) Kick the player- Parameters:
plugin
- the pluginrecipient
- the recipientplayer
- the playermessage
- the message
-