Class PluginMessageEventImpl
- java.lang.Object
-
- com.velocitypowered.api.event.connection.PluginMessageEventImpl
-
- All Implemented Interfaces:
PluginMessageEvent,Event,ResultedEvent<ResultedEvent.GenericResult>
public final class PluginMessageEventImpl extends Object implements PluginMessageEvent
This event is fired when a plugin message is sent to the proxy, either from a client (Player) or a server (ServerConnection).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description PluginMessageEventImpl(ChannelMessageSource source, ChannelMessageSink target, PluginChannelId identifier, byte[] data)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PluginChannelIdchannel()ByteArrayDataInputmessageAsDataInput()ByteArrayInputStreammessageAsInputStream()byte[]rawMessage()ResultedEvent.GenericResultresult()Returns the result associated with this event.voidsetResult(ResultedEvent.GenericResult result)Sets the result of this event.ChannelMessageSinksink()ChannelMessageSourcesource()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.velocitypowered.api.event.connection.PluginMessageEvent
setHandled
-
-
-
-
Constructor Detail
-
PluginMessageEventImpl
public PluginMessageEventImpl(ChannelMessageSource source, ChannelMessageSink target, PluginChannelId 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 Detail
-
result
public ResultedEvent.GenericResult result()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
resultin interfaceResultedEvent<ResultedEvent.GenericResult>- Returns:
- the result of this event
-
setResult
public void setResult(ResultedEvent.GenericResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ResultedEvent.GenericResult>- Parameters:
result- the new result
-
source
public ChannelMessageSource source()
- Specified by:
sourcein interfacePluginMessageEvent
-
sink
public ChannelMessageSink sink()
- Specified by:
sinkin interfacePluginMessageEvent
-
channel
public PluginChannelId channel()
- Specified by:
channelin interfacePluginMessageEvent
-
rawMessage
public byte[] rawMessage()
- Specified by:
rawMessagein interfacePluginMessageEvent
-
messageAsInputStream
public ByteArrayInputStream messageAsInputStream()
- Specified by:
messageAsInputStreamin interfacePluginMessageEvent
-
messageAsDataInput
public ByteArrayDataInput messageAsDataInput()
- Specified by:
messageAsDataInputin interfacePluginMessageEvent
-
-