public interface Packet
| Modifier and Type | Method and Description |
|---|---|
default Packet |
$less$less$less(java.lang.Object data) |
int |
getID() |
default int |
getType(java.lang.Class<?> compare) |
Player |
player()
The player sending the packet
|
default <T> T |
read(java.lang.Class<T> clazz) |
boolean |
readBoolean()
Gets a boolean at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
byte |
readByte()
Gets a byte at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
byte[] |
readBytes(int length) |
char |
readChar()
Gets a 2-byte UTF-16 character at the current
readerIndex
and increases the readerIndex by 2 in this buffer. |
default Data |
readData()
Reads a
Data type. |
double |
readDouble()
Gets a 64-bit floating point number at the current
readerIndex
and increases the readerIndex by 8 in this buffer. |
default <E extends java.lang.Enum<E>> |
readEnum() |
default <E extends java.lang.Enum<E>> |
readEnum(java.lang.Class<E> type) |
float |
readFloat()
Gets a 32-bit floating point number at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
int |
readInt()
Gets a 32-bit integer at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
default <T> java.util.List<T> |
readList() |
long |
readLong()
Gets a 64-bit integer at the current
readerIndex
and increases the readerIndex by 8 in this buffer. |
default <T> java.util.Optional<T> |
readOptional() |
default Syncable |
readPacketHandler(Syncable handler) |
default <T> java.util.Set<T> |
readSet() |
short |
readShort()
Gets a 16-bit short integer at the current
readerIndex
and increases the readerIndex by 2 in this buffer. |
default java.lang.Object |
readStorable() |
java.lang.String |
readString() |
short |
readUnsignedByte()
Gets an unsigned byte at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
long |
readUnsignedInt()
Gets an unsigned 32-bit integer at the current
readerIndex
and increases the readerIndex by 4 in this buffer. |
default org.apache.commons.math3.geometry.euclidean.twod.Vector2D |
readVector2D() |
default org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
readVector3D() |
Packet |
setID(int id)
Sets the ID of this packet, allowing it to be sent accordingly.
|
default Packet |
write(java.lang.Object data)
Writes an arbitrary object, automatically finding the relevant class.
|
Packet |
writeBoolean(boolean value)
Sets the specified boolean at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Packet |
writeByte(int value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Packet |
writeBytes(byte[] array) |
Packet |
writeChar(int value)
Sets the specified 2-byte UTF-16 character at the current
writerIndex and increases the writerIndex by 2
in this buffer. |
default Packet |
writeCollection(java.util.Collection<?> col) |
default Packet |
writeData(Data data) |
Packet |
writeDouble(double value)
Sets the specified 64-bit floating point number at the current
writerIndex and increases the writerIndex by 8
in this buffer. |
default Packet |
writeEnum(java.lang.Enum<?> data) |
Packet |
writeFloat(float value)
Sets the specified 32-bit floating point number at the current
writerIndex and increases the writerIndex by 4
in this buffer. |
Packet |
writeInt(int value)
Sets the specified 32-bit integer at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Packet |
writeLong(long value)
Sets the specified 64-bit long integer at the current
writerIndex and increases the writerIndex by 8
in this buffer. |
default Packet |
writeOptional(java.util.Optional<?> optional) |
Packet |
writeShort(int value)
Sets the specified 16-bit short integer at the current
writerIndex and increases the writerIndex by 2
in this buffer. |
default Packet |
writeStorable(Storable storable) |
Packet |
writeString(java.lang.String value) |
int getID()
Packet setID(int id)
id - The packet IDPlayer player()
default Packet write(java.lang.Object data)
data - Object to writedefault Packet $less$less$less(java.lang.Object data)
Packet writeBoolean(boolean value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 1Packet writeByte(int value)
writerIndex
and increases the writerIndex by 1 in this buffer.
The 24 high-order bits of the specified value are ignored.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 1Packet writeShort(int value)
writerIndex and increases the writerIndex by 2
in this buffer. The 16 high-order bits of the specified value are ignored.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 2Packet writeInt(int value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 4Packet writeLong(long value)
writerIndex and increases the writerIndex by 8
in this buffer.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 8Packet writeChar(int value)
writerIndex and increases the writerIndex by 2
in this buffer. The 16 high-order bits of the specified value are ignored.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 2Packet writeFloat(float value)
writerIndex and increases the writerIndex by 4
in this buffer.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 4Packet writeDouble(double value)
writerIndex and increases the writerIndex by 8
in this buffer.value - Data to writejava.lang.IndexOutOfBoundsException - if this.writableBytes is less than 8Packet writeString(java.lang.String value)
default Packet writeEnum(java.lang.Enum<?> data)
default int getType(java.lang.Class<?> compare)
default Packet writeCollection(java.util.Collection<?> col)
default Packet writeOptional(java.util.Optional<?> optional)
Packet writeBytes(byte[] array)
byte[] readBytes(int length)
boolean readBoolean()
readerIndex and increases
the readerIndex by 1 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 1byte readByte()
readerIndex and increases
the readerIndex by 1 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 1short readUnsignedByte()
readerIndex and increases
the readerIndex by 1 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 1short readShort()
readerIndex
and increases the readerIndex by 2 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 2int readInt()
readerIndex
and increases the readerIndex by 4 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 4long readUnsignedInt()
readerIndex
and increases the readerIndex by 4 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 4long readLong()
readerIndex
and increases the readerIndex by 8 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 8char readChar()
readerIndex
and increases the readerIndex by 2 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 2float readFloat()
readerIndex
and increases the readerIndex by 4 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 4double readDouble()
readerIndex
and increases the readerIndex by 8 in this buffer.java.lang.IndexOutOfBoundsException - if this.readableBytes is less than 8java.lang.String readString()
default <E extends java.lang.Enum<E>> E readEnum()
default <E extends java.lang.Enum<E>> E readEnum(java.lang.Class<E> type)
default java.lang.Object readStorable()
default <T> java.util.List<T> readList()
default <T> java.util.Set<T> readSet()
default <T> java.util.Optional<T> readOptional()
default org.apache.commons.math3.geometry.euclidean.twod.Vector2D readVector2D()
default org.apache.commons.math3.geometry.euclidean.threed.Vector3D readVector3D()
default <T> T read(java.lang.Class<T> clazz)