Class RemoteCustomMessageReceiveEvent

java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.remote.RemoteCustomMessageReceiveEvent

public class RemoteCustomMessageReceiveEvent extends Event
This event is being called when another server has sent a custom message to this server.

This system is useful when you want to communicate between servers.

Custom messages can be sent using:
- RemoteServer.sendCustomMessage(String, byte[])
- RemoteAPI.broadcastCustomMessage(String, byte[])

Keep in mind that this event is async.

  • Constructor Details

    • RemoteCustomMessageReceiveEvent

      public RemoteCustomMessageReceiveEvent(RemoteServer sender, String channel, byte[] payload)
  • Method Details

    • getSender

      public RemoteServer getSender()
      Get the server that has sent this message.
      Returns:
      The server that has sent the custom message to us
    • getChannel

      public String getChannel()
      Gets the channel parameter that has been passed into the send method on the other server.

      The channel parameter is useful as it allows you to be distant from other plugins that make use of the messaging system as well. You may e.g. insert the name of your plugin. Note that its max length is 16 bytes (1) and that it will be encoded as UTF-8. You may later use getChannel() to identify the channel again.

      Returns:
      The channel in which the messages communicate
    • getPayload

      public byte[] getPayload()
      Gets the unmodified payload.

      You may use String(byte[]) to turn it into a String.

      Returns:
      The actual message that has been sent
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()