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
Nested ClassesModifier and TypeClassDescriptionstatic classThe 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
ConstructorsConstructorDescriptionServerLoginPluginMessageEvent(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.Gets the connection from which the login plugin message was received.byte[]Returns a copy of the contents of the login plugin message sent by the server.Gets the identifier of the channel this login plugin message was sent on.Returns the result associated with this event.intGets the sequence ID of the plugin message sent by the server.voidSets 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:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>- Parameters:
result- the new result
-
getConnection
Gets the connection from which the login plugin message was received.- Returns:
- the server connection
-
getIdentifier
Gets the identifier of the channel this login plugin message was sent on.- Returns:
- the channel identifier
-
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()Gets the sequence ID of the plugin message sent by the server.- Returns:
- the sequence ID
-
toString
-