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

public abstract class BungeeSubChannel extends Channel
The sub-channel for the main BungeeCord channel
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Logger
    The logger for ease
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BungeeSubChannel(String subChannel, org.bukkit.plugin.Plugin plugin)
    Create a new sub-channel
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the sub-channel name
    void
    handleMessage(org.bukkit.entity.Player player, byte[] data)
    Handle the received data from plugin messaging
    abstract void
    handleSubChannelMessage(org.bukkit.entity.Player player, byte[] data)
    Handle the received data from plugin messaging through sub-channel
    void
    send(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data)
    Send the data via the sub-channel with the recipient
    void
    sendForward(String toServer, byte[] data)
    Forward the data to other servers
    void
    sendForward(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, String toServer, byte[] data)
    Forward the data to other servers

    Methods inherited from class me.hsgamer.hscore.bukkit.channel.Channel

    getName, getPlugin, onPluginMessageReceived, register, send, unregister

    Methods inherited from class java.lang.Object

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

    • logger

      protected final Logger logger
      The logger for ease
  • Constructor Details

    • BungeeSubChannel

      protected BungeeSubChannel(String subChannel, org.bukkit.plugin.Plugin plugin)
      Create a new sub-channel
      Parameters:
      subChannel - the sub-channel name
      plugin - the plugin
  • Method Details

    • getSubChannel

      public String 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 recipient
      toServer - the server to forward
      data - the data
    • sendForward

      public void sendForward(String toServer, byte[] data)
      Forward the data to other servers
      Parameters:
      toServer - the server to forward
      data - 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 involved
      data - 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 class Channel
      Parameters:
      player - the player involved
      data - the data
    • send

      public void send(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data)
      Send the data via the sub-channel with the recipient
      Overrides:
      send in class Channel
      Parameters:
      recipient - the recipient
      data - the data