Class RemoteCustomMessageReceiveEvent
java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.remote.RemoteCustomMessageReceiveEvent
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionRemoteCustomMessageReceiveEvent
(RemoteServer sender, String channel, byte[] payload) -
Method Summary
Modifier and TypeMethodDescriptionGets the channel parameter that has been passed into the send method on the other server.static HandlerList
byte[]
Gets the unmodified payload.Get the server that has sent this message.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
RemoteCustomMessageReceiveEvent
-
-
Method Details
-
getSender
Get the server that has sent this message.- Returns:
- The server that has sent the custom message to us
-
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 usegetChannel()
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
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-