Class BungeeUtils

java.lang.Object
me.hsgamer.hscore.bukkit.channel.BungeeUtils

public final class BungeeUtils extends Object
Methods for BungeeCord communication
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    The data output consumer
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    connectOtherToServer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String playerName, String server)
    Connect the player to the server
    static void
    connectToServer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String server)
    Connect the recipient to the server
    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
    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
    static byte[]
    Build the data byte array
    static org.bukkit.plugin.messaging.PluginMessageRecipient
    Get the global plugin message recipient
    Get the IOException consumer
    static void
    kickPlayer(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message)
    Kick the player
    static void
    register(org.bukkit.plugin.Plugin plugin)
    Register the BungeeCord main channel to the plugin
    static void
    register(org.bukkit.plugin.Plugin plugin, String channel)
    Register the channel to the plugin
    static void
    sendMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String player, String message)
    Send the message to the player
    static void
    sendPluginMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data)
    Send the data to the BungeeCord main channel
    static void
    sendPluginMessage(org.bukkit.plugin.Plugin plugin, org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String channel, byte[] data)
    Send the data to the channel
    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
    static void
    Set the IOException consumer
    static void
    unregister(org.bukkit.plugin.Plugin plugin)
    Unregister the BungeeCord main channel from the plugin
    static void
    unregister(org.bukkit.plugin.Plugin plugin, String channel)
    Unregister the channel from the plugin

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getIoExceptionConsumer

      public static Consumer<IOException> getIoExceptionConsumer()
      Get the IOException consumer
      Returns:
      the consumer
    • setIoExceptionConsumer

      public static void setIoExceptionConsumer(Consumer<IOException> ioExceptionConsumer)
      Set the IOException 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

      public static byte[] getDataBytes(BungeeUtils.DataOutputConsumer dataOutputConsumer)
      Build the data byte array
      Parameters:
      dataOutputConsumer - the consumer to build the data byte array
      Returns:
      the data byte array
    • register

      public static void register(org.bukkit.plugin.Plugin plugin, String channel)
      Register the channel to the plugin
      Parameters:
      plugin - the plugin
      channel - the channel
    • unregister

      public static void unregister(org.bukkit.plugin.Plugin plugin, String channel)
      Unregister the channel from the plugin
      Parameters:
      plugin - the plugin
      channel - 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 plugin
      recipient - the recipient
      channel - the channel
      data - 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 plugin
      recipient - the recipient
      data - 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 plugin
      recipient - the recipient
      server - 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 plugin
      recipient - the recipient
      playerName - the player name
      server - 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 plugin
      recipient - the recipient
      player - the player
      message - 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 plugin
      recipient - the recipient
      player - the player
      message - 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 plugin
      recipient - the recipient
      server - the server
      channel - the channel
      data - 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 plugin
      recipient - the recipient
      player - the player
      channel - the channel
      data - 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 plugin
      recipient - the recipient
      player - the player
      message - the message