Class ServerLoginPluginMessageEvent
- java.lang.Object
-
- com.velocitypowered.api.event.player.ServerLoginPluginMessageEvent
-
- All Implemented Interfaces:
ResultedEvent<ServerLoginPluginMessageEvent.ResponseResult>
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServerLoginPluginMessageEvent.ResponseResult-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description ServerLoginPluginMessageEvent(ServerConnection connection, ChannelIdentifier identifier, byte[] contents, int sequenceId)Constructs a newServerLoginPluginMessageEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArrayDataInputcontentsAsDataStream()Returns the contents of the login plugin message sent by the server as anByteArrayDataInput.ByteArrayInputStreamcontentsAsInputStream()Returns the contents of the login plugin message sent by the server as anInputStream.ServerConnectiongetConnection()byte[]getContents()Returns a copy of the contents of the login plugin message sent by the server.ChannelIdentifiergetIdentifier()ServerLoginPluginMessageEvent.ResponseResultgetResult()Returns the result associated with this event.intgetSequenceId()voidsetResult(ServerLoginPluginMessageEvent.ResponseResult result)Sets the result of this event.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
getResult
public ServerLoginPluginMessageEvent.ResponseResult 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
public void setResult(ServerLoginPluginMessageEvent.ResponseResult result)
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
public ServerConnection getConnection()
-
getIdentifier
public ChannelIdentifier 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
public ByteArrayInputStream 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
public ByteArrayDataInput 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()
-
-