public final class GlowBufUtils extends Object
Modifier and Type | Method and Description |
---|---|
static org.bukkit.util.BlockVector |
readBlockPosition(io.netty.buffer.ByteBuf buf)
Read an encoded block vector (position) from the buffer.
|
static TextMessage |
readChat(io.netty.buffer.ByteBuf buf)
Read an encoded chat message from the buffer.
|
static CompoundTag |
readCompound(io.netty.buffer.ByteBuf buf)
Read an uncompressed compound NBT tag from the buffer.
|
static org.bukkit.inventory.EquipmentSlot |
readHand(io.netty.buffer.ByteBuf buf) |
static List<MetadataMap.Entry> |
readMetadata(io.netty.buffer.ByteBuf buf)
Read a list of mob metadata entries from the buffer.
|
static org.bukkit.inventory.ItemStack |
readSlot(io.netty.buffer.ByteBuf buf)
Read an item stack from the buffer.
|
static org.bukkit.inventory.ItemStack |
readSlot(io.netty.buffer.ByteBuf buf,
boolean network)
Read an item stack from the buffer.
|
static UUID |
readUuid(io.netty.buffer.ByteBuf buf)
Read a UUID encoded as two longs from the buffer.
|
static void |
writeBlockPosition(io.netty.buffer.ByteBuf buf,
long x,
long y,
long z)
Write an encoded block vector (position) to the buffer.
|
static void |
writeBlockPosition(io.netty.buffer.ByteBuf buf,
org.bukkit.util.Vector vector)
Write an encoded block vector (position) to the buffer.
|
static void |
writeChat(io.netty.buffer.ByteBuf buf,
TextMessage text)
Write an encoded chat message to the buffer.
|
static void |
writeCompound(io.netty.buffer.ByteBuf buf,
CompoundTag data)
Write an uncompressed compound NBT tag to the buffer.
|
static void |
writeHand(io.netty.buffer.ByteBuf buf,
org.bukkit.inventory.EquipmentSlot hand) |
static void |
writeMetadata(io.netty.buffer.ByteBuf buf,
List<MetadataMap.Entry> entries)
Write a list of mob metadata entries to the buffer.
|
static void |
writeSlot(io.netty.buffer.ByteBuf buf,
org.bukkit.inventory.ItemStack stack)
Write an item stack to the buffer.
|
static void |
writeUuid(io.netty.buffer.ByteBuf buf,
UUID uuid)
Write a UUID encoded as two longs to the buffer.
|
public static List<MetadataMap.Entry> readMetadata(io.netty.buffer.ByteBuf buf) throws IOException
buf
- The buffer.IOException
- if the buffer could not be readpublic static void writeMetadata(io.netty.buffer.ByteBuf buf, List<MetadataMap.Entry> entries) throws IOException
buf
- The buffer.entries
- The metadata.IOException
- if the buffer could not be written topublic static CompoundTag readCompound(io.netty.buffer.ByteBuf buf)
buf
- The buffer.public static void writeCompound(io.netty.buffer.ByteBuf buf, CompoundTag data)
buf
- The buffer.data
- The tag to write, or null.public static org.bukkit.inventory.ItemStack readSlot(io.netty.buffer.ByteBuf buf)
buf
- The buffer.public static org.bukkit.inventory.ItemStack readSlot(io.netty.buffer.ByteBuf buf, boolean network)
buf
- The buffer.network
- Mark network source.public static void writeSlot(io.netty.buffer.ByteBuf buf, org.bukkit.inventory.ItemStack stack)
buf
- The buffer.stack
- The stack to write, or null.public static org.bukkit.util.BlockVector readBlockPosition(io.netty.buffer.ByteBuf buf)
buf
- The buffer.public static void writeBlockPosition(io.netty.buffer.ByteBuf buf, org.bukkit.util.Vector vector)
buf
- The buffer.vector
- The vector to write.public static void writeBlockPosition(io.netty.buffer.ByteBuf buf, long x, long y, long z)
buf
- The buffer.x
- The x value.y
- The y value.z
- The z value.public static UUID readUuid(io.netty.buffer.ByteBuf buf)
buf
- The buffer.public static void writeUuid(io.netty.buffer.ByteBuf buf, UUID uuid)
buf
- The buffer.uuid
- The UUID to write.public static TextMessage readChat(io.netty.buffer.ByteBuf buf) throws IOException
buf
- The buffer.IOException
- on read failure.public static void writeChat(io.netty.buffer.ByteBuf buf, TextMessage text) throws IOException
buf
- The buffer.text
- The chat message to write.IOException
- on write failure.public static org.bukkit.inventory.EquipmentSlot readHand(io.netty.buffer.ByteBuf buf) throws IOException
IOException
public static void writeHand(io.netty.buffer.ByteBuf buf, org.bukkit.inventory.EquipmentSlot hand)
Copyright © 2021. All rights reserved.