Class PluginMessageEvent
java.lang.Object
com.velocitypowered.api.event.connection.PluginMessageEvent
- All Implemented Interfaces:
ResultedEvent<PluginMessageEvent.ForwardResult>
@AwaitingEvent
public final class PluginMessageEvent
extends Object
implements ResultedEvent<PluginMessageEvent.ForwardResult>
This event is fired when a plugin message is sent to the proxy, either from a client (
Player
) or a server (ServerConnection
). Velocity will wait on this event to finish
firing before discarding the sent plugin message (if handled) or forwarding it to the server.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A result determining whether or not to forward this message on.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
Constructor Summary
ConstructorDescriptionPluginMessageEvent
(ChannelMessageSource source, ChannelMessageSink target, ChannelIdentifier identifier, byte[] data) Creates a new instance. -
Method Summary
-
Constructor Details
-
PluginMessageEvent
public PluginMessageEvent(ChannelMessageSource source, ChannelMessageSink target, ChannelIdentifier identifier, byte[] data) Creates a new instance.- Parameters:
source
- the source of the plugin messagetarget
- the destination of the plugin messageidentifier
- the channel for this plugin messagedata
- the payload of the plugin message
-
-
Method Details
-
getResult
Description copied from interface:ResultedEvent
Returns the result associated with this event.- Specified by:
getResult
in interfaceResultedEvent<PluginMessageEvent.ForwardResult>
- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEvent
Sets the result of this event. The result must be non-null.- Specified by:
setResult
in interfaceResultedEvent<PluginMessageEvent.ForwardResult>
- Parameters:
result
- the new result
-
getSource
-
getTarget
-
getIdentifier
-
getData
public byte[] getData() -
dataAsInputStream
-
dataAsDataStream
-
toString
-