Package sawfowl.commandpack.api.events
Interface RecievePacketEvent
- All Superinterfaces:
Event
This event is called when data packets are transmitted from the client to the server.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData()
RawSettings data.Data converted to a string.
The method should be safe (with standard Minecraft packages it is, WeCui package is also processed normally),
but it is desirable to test it before full use.
Be sure to check the package ID before using this method,
it will save you from working with unnecessary data and reduce the risk of failed decryption to a minimum.The player from whom the data packet was received.Data packet identifier.UUID of the player from whom the data packet was received.boolean
Returns true if and only if (this.writerIndex - this.readerIndex) is greater than 0.int
Returns the number of readable bytes which is equal to (this.writerIndex - this.readerIndex).
-
Method Details
-
getPlayerUniqueId
UUID getPlayerUniqueId()UUID of the player from whom the data packet was received. -
getMixinPlayer
MixinServerPlayer getMixinPlayer()The player from whom the data packet was received.- Returns:
MixinServerPlayer
-
getPacketName
String getPacketName()Data packet identifier. -
getData
byte[] getData()RawSettings data. -
readableBytes
int readableBytes()Returns the number of readable bytes which is equal to (this.writerIndex - this.readerIndex). -
getDataAsString
String getDataAsString()Data converted to a string.
The method should be safe (with standard Minecraft packages it is, WeCui package is also processed normally),
but it is desirable to test it before full use.
Be sure to check the package ID before using this method,
it will save you from working with unnecessary data and reduce the risk of failed decryption to a minimum. -
isReadable
boolean isReadable()Returns true if and only if (this.writerIndex - this.readerIndex) is greater than 0.- Returns:
-