Class StargateBungeePluginMessageListener

java.lang.Object
org.sgrewritten.stargate.listener.StargateBungeePluginMessageListener
All Implemented Interfaces:
org.bukkit.plugin.messaging.PluginMessageListener

public class StargateBungeePluginMessageListener extends Object implements org.bukkit.plugin.messaging.PluginMessageListener
Listens for and handles any received plugin messages

Sends plugin enable message to all servers. Sends all loaded bungee-portals to all servers.

Author:
Thorin
  • Constructor Details

    • StargateBungeePluginMessageListener

      public StargateBungeePluginMessageListener(BungeeManager bungeeManager)
      Instantiates a new stargate bungee plugin message listener
      Parameters:
      bungeeManager -

      Manager for bungee related events

  • Method Details

    • onPluginMessageReceived

      public void onPluginMessageReceived(@NotNull @NotNull String channel, @NotNull @NotNull org.bukkit.entity.Player unused, byte[] message)
      Handles relevant received plugin messages

      Types of messages that can be received and their response:

      • All loaded portals messages - add all loaded portals as "virtual portals"
      • Plugin enabled message - send all loaded portals message to specific server
      • portal destroyed message - remove virtual portal from specific network
      • portal added message - add virtual portal from specific network
      • plugin disable message - remove all virtual portals given in message
      • portal open message - open selected portal. Too much ?
      Specified by:
      onPluginMessageReceived in interface org.bukkit.plugin.messaging.PluginMessageListener
      Parameters:
      channel - The channel being used to send the message.
      unused - A player object.
      message - The message being processed.