Class ServerLoginPluginMessageEvent
java.lang.Object
com.velocitypowered.api.event.player.ServerLoginPluginMessageEvent
- All Implemented Interfaces:
ResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>
@AwaitingEvent
public class ServerLoginPluginMessageEvent
extends Object
implements ResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>
Fired when a server sends a login plugin message to the proxy. Plugins have the opportunity to
respond to the messages as needed. Velocity will wait on this event to finish. The server will
be responsible for continuing the login process once the server is satisfied with any login
plugin responses sent by proxy plugins (or messages indicating a lack of response).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The result class, containing a response to the login plugin message sent by the server.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
Constructor Summary
ConstructorDescriptionServerLoginPluginMessageEvent
(ServerConnection connection, ChannelIdentifier identifier, byte[] contents, int sequenceId) Constructs a newServerLoginPluginMessageEvent
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the contents of the login plugin message sent by the server as anByteArrayDataInput
.Returns the contents of the login plugin message sent by the server as anInputStream
.byte[]
Returns a copy of the contents of the login plugin message sent by the server.Returns the result associated with this event.int
void
Sets the result of this event.toString()
-
Constructor Details
-
ServerLoginPluginMessageEvent
public ServerLoginPluginMessageEvent(ServerConnection connection, ChannelIdentifier identifier, byte[] contents, int sequenceId) Constructs a newServerLoginPluginMessageEvent
.- Parameters:
connection
- the connection on which the plugin message was sentidentifier
- the channel identifier for the message sentcontents
- the contents of the messagesequenceId
- the ID of the message
-
-
Method Details
-
getResult
Description copied from interface:ResultedEvent
Returns the result associated with this event.- Specified by:
getResult
in interfaceResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>
- 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<ServerLoginPluginMessageEvent.ResponseResult>
- Parameters:
result
- the new result
-
getConnection
-
getIdentifier
-
getContents
public byte[] getContents()Returns a copy of the contents of the login plugin message sent by the server.- Returns:
- the contents of the message
-
contentsAsInputStream
Returns the contents of the login plugin message sent by the server as anInputStream
.- Returns:
- the contents of the message as a stream
-
contentsAsDataStream
Returns the contents of the login plugin message sent by the server as anByteArrayDataInput
.- Returns:
- the contents of the message as a
DataInput
-
getSequenceId
public int getSequenceId() -
toString
-