Class Channel

java.lang.Object
me.hsgamer.hscore.bukkit.channel.Channel
All Implemented Interfaces:
org.bukkit.plugin.messaging.PluginMessageListener
Direct Known Subclasses:
BungeeSubChannel

public abstract class Channel extends Object implements org.bukkit.plugin.messaging.PluginMessageListener
The base channel
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Channel(String name, org.bukkit.plugin.Plugin plugin)
    Create a new channel
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the channel's name
    org.bukkit.plugin.Plugin
    Get the plugin providing the channel
    abstract void
    handleMessage(org.bukkit.entity.Player player, byte[] data)
    Handle the received data from plugin messaging
    void
    onPluginMessageReceived(String channel, org.bukkit.entity.Player player, byte[] data)
     
    void
    Register the channel
    void
    send(byte[] data)
    Send the data via the channel
    void
    send(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data)
    Send the data via the channel with the recipient
    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, org.bukkit.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(org.bukkit.entity.Player player, byte[] data)
      Handle the received data from plugin messaging
      Parameters:
      player - the player involved
      data - the data
    • send

      public void send(byte[] data)
      Send the data via the channel
      Parameters:
      data - the data
    • send

      public void send(org.bukkit.plugin.messaging.PluginMessageRecipient recipient, byte[] data)
      Send the data via the channel with the recipient
      Parameters:
      recipient - the recipient
      data - the data
    • onPluginMessageReceived

      public void onPluginMessageReceived(String channel, org.bukkit.entity.Player player, byte[] data)
      Specified by:
      onPluginMessageReceived in interface org.bukkit.plugin.messaging.PluginMessageListener
    • getName

      public String getName()
      Get the channel's name
      Returns:
      the name
    • getPlugin

      public org.bukkit.plugin.Plugin getPlugin()
      Get the plugin providing the channel
      Returns:
      the plugin