public class PacketSerializer
extends io.netty.buffer.UnpooledHeapByteBuf
Constructor and Description |
---|
PacketSerializer(io.netty.buffer.ByteBuf buf)
Create new packet serializer.
|
PacketSerializer(@Nullable Player p)
Create new packet serializer
|
PacketSerializer(@Nullable Player p,
byte[] array) |
PacketSerializer(@Nullable Player p,
byte[] array,
int maxLength) |
PacketSerializer(@Nullable Player p,
io.netty.buffer.ByteBuf buf)
Create new packet serializer for the given player
|
Modifier and Type | Method and Description |
---|---|
<T extends Enum<T>> |
getEnum(Class<T> oclass) |
@Nullable Player |
getPlayer() |
byte[] |
readAvailableBytes() |
BlockPosition |
readBlockPosition(Version version) |
BlockPosition |
readBlockPositionShort() |
byte[] |
readByteArray() |
byte[] |
readByteArray(int maxSize) |
BlockPosition |
readChunkSectionPosition() |
Instant |
readInstant() |
int |
readInt(int byteAmount) |
ItemStack |
readItemStack()
Deprecated.
|
ItemStack |
readItemStack(Version version)
Read item stack according to given version
WARN: This will always return null, it just pass through bytes |
long[] |
readLongArray() |
long[] |
readLongArray(int maxSize) |
com.github.steveice10.opennbt.tag.builtin.CompoundTag |
readNBTTag()
Read NBT tag
|
Vector |
readShortVector() |
String |
readString() |
String |
readString(int size) |
UUID |
readUUID() |
int |
readVarInt() |
long |
readVarLong() |
Vector |
readVector() |
void |
write(UUID uuid) |
void |
writeByteArray(byte[] bytes) |
void |
writeEnum(Enum<?> oenum) |
void |
writeString(String s) |
void |
writeVarInt(int i) |
void |
writeVarLong(long i) |
_getByte, _getInt, _getIntLE, _getLong, _getLongLE, _getShort, _getShortLE, _getUnsignedMedium, _getUnsignedMediumLE, _setByte, _setInt, _setIntLE, _setLong, _setLongLE, _setMedium, _setMediumLE, _setShort, _setShortLE, alloc, allocateArray, array, arrayOffset, capacity, capacity, copy, deallocate, freeArray, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getBytes, getInt, getIntLE, getLong, getLongLE, getShort, getShortLE, getUnsignedMedium, getUnsignedMediumLE, hasArray, hasMemoryAddress, internalNioBuffer, isContiguous, isDirect, memoryAddress, nioBuffer, nioBufferCount, nioBuffers, order, readBytes, readBytes, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, setBytes, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, unwrap
refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touch
adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getMedium, getMediumLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setZero, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZero
public PacketSerializer(io.netty.buffer.ByteBuf buf)
buf
- actual bufferpublic PacketSerializer(@Nullable Player p)
p
- concerned playerpublic PacketSerializer(@Nullable Player p, io.netty.buffer.ByteBuf buf)
p
- the concerned playerbuf
- the used bufferpublic PacketSerializer(@Nullable Player p, byte[] array)
public PacketSerializer(@Nullable Player p, byte[] array, int maxLength)
public @Nullable Player getPlayer()
public int readVarInt()
public int readInt(int byteAmount)
public void writeEnum(Enum<?> oenum)
public long readVarLong()
public void write(UUID uuid)
public UUID readUUID()
public void writeVarInt(int i)
public void writeVarLong(long i)
public byte[] readAvailableBytes()
public Instant readInstant()
public String readString()
public String readString(int size)
public void writeString(String s)
public com.github.steveice10.opennbt.tag.builtin.CompoundTag readNBTTag()
@Deprecated public ItemStack readItemStack()
public ItemStack readItemStack(Version version)
version
- the versionpublic BlockPosition readChunkSectionPosition()
public BlockPosition readBlockPosition(Version version)
public BlockPosition readBlockPositionShort()
public Vector readVector()
public Vector readShortVector()
public long[] readLongArray()
public long[] readLongArray(int maxSize)
public byte[] readByteArray()
public byte[] readByteArray(int maxSize)
public void writeByteArray(byte[] bytes)