Class Channel

java.lang.Object
me.hsgamer.hscore.bungeecord.channel.Channel

public abstract class Channel extends Object
The base channel
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Channel(String name, net.md_5.bungee.api.plugin.Plugin plugin)
    Create a new channel
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the channel's name
    net.md_5.bungee.api.plugin.Plugin
    Get the plugin providing the channel
    abstract void
    handleMessage(net.md_5.bungee.api.event.PluginMessageEvent event)
    Handle the received data from plugin messaging
    void
    Register the channel
    void
    send(net.md_5.bungee.api.config.ServerInfo server, byte[] data)
    Send the data to a server
    void
    send(net.md_5.bungee.api.connection.ProxiedPlayer player, byte[] data)
    Send the data to a player
    void
    sendAll(byte[] data)
    Send the data to all servers
    void
    sendAll(byte[] data, boolean hasPlayer)
    Send the data to all servers
    void
    Unregister the channel

    Methods inherited from class java.lang.Object

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

    • Channel

      protected Channel(String name, net.md_5.bungee.api.plugin.Plugin plugin)
      Create a new channel
      Parameters:
      name - the channel name
      plugin - 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 data
      hasPlayer - 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 server
      data - 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 player
      data - the data
    • getName

      public String 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