Class PacketCustom

java.lang.Object
codechicken.lib.data.MCDataByteBuf
codechicken.lib.packet.PacketCustom
All Implemented Interfaces:
MCDataInput, MCDataOutput

@Deprecated(forRemoval=true) public final class PacketCustom extends MCDataByteBuf
Deprecated, for removal: This API element is subject to removal in a future version.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface codechicken.lib.data.MCDataInput

    MCDataInput.InputStreamWrapper

    Nested classes/interfaces inherited from interface codechicken.lib.data.MCDataOutput

    MCDataOutput.OutputStreamWrapper
  • Field Summary

    Fields inherited from class codechicken.lib.data.MCDataByteBuf

    buf
  • Constructor Summary

    Constructors
    Constructor
    Description
    PacketCustom(net.minecraft.resources.Identifier channel, int type, @Nullable net.minecraft.core.RegistryAccess registryAccess)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    append(byte[] bytes)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Appends the content of the array to the end of this buffer.
    append(io.netty.buffer.ByteBuf buf)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Appends a ByteBuf to the end of this stream.
    net.minecraft.resources.Identifier
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToAllAround(double x, double y, double z, double range, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToAllAround(net.minecraft.core.BlockPos pos, double range, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToChunk(net.minecraft.server.level.ServerLevel level, int chunkX, int chunkZ)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToChunk(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToChunk(net.minecraft.server.level.ServerLevel level, net.minecraft.world.level.ChunkPos pos)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToChunk(net.minecraft.world.level.block.entity.BlockEntity tile)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    sendToPlayer(@Nullable net.minecraft.server.level.ServerPlayer player)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    net.minecraft.network.protocol.Packet<?>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    net.minecraft.network.protocol.common.custom.CustomPacketPayload
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    net.minecraft.network.protocol.Packet<?>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    writeBoolean(boolean b)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a boolean to the stream.
    writeBooleans(boolean[] b)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeBooleans(boolean[] b, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeByte(int p0)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a byte to the stream.
    writeByteBuf(io.netty.buffer.ByteBuf buf)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a ByteBuf to the stream, including its length.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a ByteBuffer to the stream.
    writeBytes(byte[] b)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeBytes(byte[] b, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeChar(int c)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a char to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a CharBuffer to the stream.
    writeChars(char[] c)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeChars(char[] c, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeCompoundNBT(net.minecraft.nbt.CompoundTag tag)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a CompoundTag to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Cuboid6 to the stream.
    writeDirection(net.minecraft.core.Direction dir)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Direction to the stream.
    writeDouble(double p0)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a double to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a DoubleBuffer to the stream.
    writeDoubles(double[] d)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeDoubles(double[] d, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeEnum(Enum<?> value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an Enum value to the stream.
    writeFloat(float f)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a float to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a FloatBuffer to the stream.
    writeFloats(float[] f)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeFloats(float[] f, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeFluidStack(net.neoforged.neoforge.fluids.FluidStack stack)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a FluidStack to the stream.
    writeInt(int p0)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a int to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a IntBuffer to the stream.
    writeInts(int[] i)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeInts(int[] i, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeItemStack(net.minecraft.world.item.ItemStack stack)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an ItemStack to the stream.
    writeLong(long l)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a long to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a LongBuffer to the stream.
    writeLongs(long[] l)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeLongs(long[] l, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeNullableCompoundNBT(@Nullable net.minecraft.nbt.CompoundTag tag)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Nullable CompoundTag to the stream.
    writePos(net.minecraft.core.BlockPos pos)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a BlockPos to the stream.
    writeRegistryId(net.minecraft.core.Registry<T> registry, net.minecraft.resources.Identifier entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes the id associated with the given name to the stream encoding both the registry name and object's id.
    writeRegistryId(net.minecraft.core.Registry<T> registry, T entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes the given object to the stream encoding both the registry name and object's id.
    writeRegistryIdDirect(net.minecraft.core.Registry<T> registry, net.minecraft.resources.Identifier entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes the id associated with the given name to the stream.
    writeRegistryIdDirect(net.minecraft.core.Registry<T> registry, T entry)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a forge registry object's id to the stream.
    writeResourceLocation(net.minecraft.resources.Identifier loc)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Identifier to the stream.
    writeShort(int p0)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a short to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a ShortBuffer to the stream.
    writeShorts(short[] s)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    writeShorts(short[] s, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array to the stream, including its length.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a UTF-8 Encoded String to the stream.
    writeString(String s, int maxLen)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a UTF-8 Encoded String to the stream.
    writeTextComponent(net.minecraft.network.chat.Component component)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Component to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a UUID to the stream.
    writeVarInt(int i)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Variable length int.
    writeVarInts(int[] i)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length ints to the stream.
    writeVarInts(int[] i, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length ints to the stream.
    writeVarLong(long l)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Variable length long.
    writeVarLongs(long[] l)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length longs to the stream.
    writeVarLongs(long[] l, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length longs to the stream.
    writeVec3d(net.minecraft.world.phys.Vec3 vec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Vec3 to the stream.
    writeVec3i(net.minecraft.core.Vec3i vec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Vec3i to the stream.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Vector3 to the stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PacketCustom

      public PacketCustom(net.minecraft.resources.Identifier channel, int type, @Nullable @Nullable net.minecraft.core.RegistryAccess registryAccess)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • isInbound

      public boolean isInbound()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getType

      public int getType()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getChannel

      public net.minecraft.resources.Identifier getChannel()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toCustomPayload

      public net.minecraft.network.protocol.common.custom.CustomPacketPayload toCustomPayload()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toClientPacket

      public net.minecraft.network.protocol.Packet<?> toClientPacket()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToPlayer

      public void sendToPlayer(@Nullable @Nullable net.minecraft.server.level.ServerPlayer player)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToAllPlayers

      public void sendToAllPlayers()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToAllAround

      public void sendToAllAround(net.minecraft.core.BlockPos pos, double range, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToAllAround

      public void sendToAllAround(double x, double y, double z, double range, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToDimension

      public void sendToDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToChunk

      public void sendToChunk(net.minecraft.world.level.block.entity.BlockEntity tile)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToChunk

      public void sendToChunk(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToChunk

      public void sendToChunk(net.minecraft.server.level.ServerLevel level, int chunkX, int chunkZ)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToChunk

      public void sendToChunk(net.minecraft.server.level.ServerLevel level, net.minecraft.world.level.ChunkPos pos)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToOps

      public void sendToOps()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toServerPacket

      public net.minecraft.network.protocol.Packet<?> toServerPacket()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • sendToServer

      public void sendToServer()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • writeByte

      public PacketCustom writeByte(int p0)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a byte to the stream.
      Specified by:
      writeByte in interface MCDataOutput
      Overrides:
      writeByte in class MCDataByteBuf
      Parameters:
      p0 - The byte.
      Returns:
      The same stream.
    • writeChar

      public PacketCustom writeChar(int c)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a char to the stream.
      Specified by:
      writeChar in interface MCDataOutput
      Overrides:
      writeChar in class MCDataByteBuf
      Parameters:
      c - The char.
      Returns:
      The same stream.
    • writeShort

      public PacketCustom writeShort(int p0)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a short to the stream.
      Specified by:
      writeShort in interface MCDataOutput
      Overrides:
      writeShort in class MCDataByteBuf
      Parameters:
      p0 - The short.
      Returns:
      The same stream.
    • writeInt

      public PacketCustom writeInt(int p0)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a int to the stream.
      Specified by:
      writeInt in interface MCDataOutput
      Overrides:
      writeInt in class MCDataByteBuf
      Parameters:
      p0 - The int.
      Returns:
      The same stream.
    • writeLong

      public PacketCustom writeLong(long l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a long to the stream.
      Specified by:
      writeLong in interface MCDataOutput
      Overrides:
      writeLong in class MCDataByteBuf
      Parameters:
      l - The long.
      Returns:
      The same stream.
    • writeFloat

      public PacketCustom writeFloat(float f)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a float to the stream.
      Specified by:
      writeFloat in interface MCDataOutput
      Overrides:
      writeFloat in class MCDataByteBuf
      Parameters:
      f - The float.
      Returns:
      The same stream.
    • writeDouble

      public PacketCustom writeDouble(double p0)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a double to the stream.
      Specified by:
      writeDouble in interface MCDataOutput
      Overrides:
      writeDouble in class MCDataByteBuf
      Parameters:
      p0 - The double.
      Returns:
      The same stream.
    • writeBoolean

      public PacketCustom writeBoolean(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a boolean to the stream.
      Specified by:
      writeBoolean in interface MCDataOutput
      Overrides:
      writeBoolean in class MCDataByteBuf
      Parameters:
      b - The boolean.
      Returns:
      The same stream.
    • writeBytes

      public PacketCustom writeBytes(byte[] b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      Returns:
      The same stream.
    • writeBytes

      public PacketCustom writeBytes(byte[] b, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeChars

      public PacketCustom writeChars(char[] c)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      c - The array.
      Returns:
      The same stream.
    • writeChars

      public PacketCustom writeChars(char[] c, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      c - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeShorts

      public PacketCustom writeShorts(short[] s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      s - The array.
      Returns:
      The same stream.
    • writeShorts

      public PacketCustom writeShorts(short[] s, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      s - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeInts

      public PacketCustom writeInts(int[] i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      Returns:
      The same stream.
    • writeInts

      public PacketCustom writeInts(int[] i, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeLongs

      public PacketCustom writeLongs(long[] l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      Returns:
      The same stream.
    • writeLongs

      public PacketCustom writeLongs(long[] l, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeFloats

      public PacketCustom writeFloats(float[] f)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      f - The array.
      Returns:
      The same stream.
    • writeFloats

      public PacketCustom writeFloats(float[] f, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      f - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeDoubles

      public PacketCustom writeDoubles(double[] d)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      d - The array.
      Returns:
      The same stream.
    • writeDoubles

      public PacketCustom writeDoubles(double[] d, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      d - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeBooleans

      public PacketCustom writeBooleans(boolean[] b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      Returns:
      The same stream.
    • writeBooleans

      public PacketCustom writeBooleans(boolean[] b, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array to the stream, including its length. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • append

      public PacketCustom append(byte[] bytes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Appends the content of the array to the end of this buffer.
      Parameters:
      bytes - The array.
      Returns:
      The same stream.
    • writeVarInt

      public PacketCustom writeVarInt(int i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Variable length int. Doesn't handle Signed ints well, they end up as 5 bytes, instead of 4, Use MCDataOutput.writeSignedVarInt(int) if you require numbers <= -1
      Parameters:
      i - The int.
      Returns:
      The same stream.
    • writeVarLong

      public PacketCustom writeVarLong(long l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Variable length long. Doesn't handle Signed longs well, they end up as 10 bytes, instead of 8, Use MCDataOutput.writeSignedVarLong(long) if you require numbers <= -1
      Parameters:
      l - The long.
      Returns:
      The same stream.
    • writeVarInts

      public PacketCustom writeVarInts(int[] i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array of Variable length ints to the stream. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      Returns:
      The same stream.
    • writeVarInts

      public PacketCustom writeVarInts(int[] i, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array of Variable length ints to the stream. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeVarLongs

      public PacketCustom writeVarLongs(long[] l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array of Variable length longs to the stream. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      Returns:
      The same stream.
    • writeVarLongs

      public PacketCustom writeVarLongs(long[] l, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an array of Variable length longs to the stream. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      off - An offset into the array to start reading from.
      len - How many elements to read.
      Returns:
      The same stream.
    • writeString

      public PacketCustom writeString(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a UTF-8 Encoded String to the stream. Forces a length of 32767 encoded bytes.
      Parameters:
      s - The String.
      Returns:
      The same stream.
    • writeString

      public PacketCustom writeString(String s, int maxLen)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a UTF-8 Encoded String to the stream.
      Parameters:
      s - The String.
      maxLen - The maximum number of bytes to write, extra bytes will cause an EncoderException.
      Returns:
      The same stream.
    • writeUUID

      public PacketCustom writeUUID(UUID uuid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a UUID to the stream.
      Parameters:
      uuid - The UUID.
      Returns:
      The same stream.
    • writeEnum

      public PacketCustom writeEnum(Enum<?> value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an Enum value to the stream.
      Parameters:
      value - The Enum value to write.
      Returns:
      The same stream.
    • writeByteBuffer

      public PacketCustom writeByteBuffer(ByteBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a ByteBuffer to the stream.
      Parameters:
      buffer - The ByteBuffer.
      Returns:
      The same stream.
    • writeCharBuffer

      public PacketCustom writeCharBuffer(CharBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a CharBuffer to the stream.
      Parameters:
      buffer - The CharBuffer.
      Returns:
      The same stream.
    • writeShortBuffer

      public PacketCustom writeShortBuffer(ShortBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a ShortBuffer to the stream.
      Parameters:
      buffer - The ShortBuffer.
      Returns:
      The same stream.
    • writeIntBuffer

      public PacketCustom writeIntBuffer(IntBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a IntBuffer to the stream.
      Parameters:
      buffer - The IntBuffer.
      Returns:
      The same stream.
    • writeLongBuffer

      public PacketCustom writeLongBuffer(LongBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a LongBuffer to the stream.
      Parameters:
      buffer - The LongBuffer.
      Returns:
      The same stream.
    • writeFloatBuffer

      public PacketCustom writeFloatBuffer(FloatBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a FloatBuffer to the stream.
      Parameters:
      buffer - The FloatBuffer.
      Returns:
      The same stream.
    • writeDoubleBuffer

      public PacketCustom writeDoubleBuffer(DoubleBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a DoubleBuffer to the stream.
      Parameters:
      buffer - The DoubleBuffer.
      Returns:
      The same stream.
    • writeVector

      public PacketCustom writeVector(Vector3 vec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Vector3 to the stream.
      Parameters:
      vec - The Vector3.
      Returns:
      The same stream.
    • writeCuboid

      public PacketCustom writeCuboid(Cuboid6 cuboid)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Cuboid6 to the stream.
      Parameters:
      cuboid - The Cuboid6
      Returns:
      The same stream.
    • writeResourceLocation

      public PacketCustom writeResourceLocation(net.minecraft.resources.Identifier loc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Identifier to the stream.
      Parameters:
      loc - The Identifier.
      Returns:
      The same stream.
    • writeDirection

      public PacketCustom writeDirection(net.minecraft.core.Direction dir)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Direction to the stream.
      Parameters:
      dir - The Direction.
      Returns:
      The same stream.
    • writePos

      public PacketCustom writePos(net.minecraft.core.BlockPos pos)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a BlockPos to the stream.
      Parameters:
      pos - The BlockPos.
      Returns:
      The same stream.
    • writeVec3i

      public PacketCustom writeVec3i(net.minecraft.core.Vec3i vec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Vec3i to the stream.
      Parameters:
      vec - The Vec3i.
      Returns:
      The same stream.
    • writeVec3d

      public PacketCustom writeVec3d(net.minecraft.world.phys.Vec3 vec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Vec3 to the stream.
      Parameters:
      vec - The Vec3.
      Returns:
      The same stream.
    • writeCompoundNBT

      public PacketCustom writeCompoundNBT(net.minecraft.nbt.CompoundTag tag)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a CompoundTag to the stream.
      Parameters:
      tag - The CompoundTag.
      Returns:
      The same stream.
    • writeNullableCompoundNBT

      public PacketCustom writeNullableCompoundNBT(@Nullable @Nullable net.minecraft.nbt.CompoundTag tag)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Nullable CompoundTag to the stream.
      Parameters:
      tag - The CompoundTag or null.
      Returns:
      The same stream.
    • writeFluidStack

      public PacketCustom writeFluidStack(net.neoforged.neoforge.fluids.FluidStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a FluidStack to the stream.
      Parameters:
      stack - The FluidStack.
      Returns:
      The same stream.
    • writeItemStack

      public PacketCustom writeItemStack(net.minecraft.world.item.ItemStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes an ItemStack to the stream.

      It should also be noted that this implementation writes the ItemStack.getCount() as a varInt opposed to a byte, as that is favourable in some cases.

      Parameters:
      stack - The ItemStack.
      Returns:
      The same stream.
    • writeTextComponent

      public PacketCustom writeTextComponent(net.minecraft.network.chat.Component component)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a Component to the stream.
      Parameters:
      component - The Component.
      Returns:
      The same stream.
    • writeRegistryIdDirect

      public <T> PacketCustom writeRegistryIdDirect(net.minecraft.core.Registry<T> registry, T entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a forge registry object's id to the stream. This method does not encode the Registry name to the packet, only the object's id.
      Parameters:
      registry - The registry that owns entry.
      entry - The object to write to the stream.
      Returns:
      The same stream.
    • writeRegistryIdDirect

      public <T> PacketCustom writeRegistryIdDirect(net.minecraft.core.Registry<T> registry, net.minecraft.resources.Identifier entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes the id associated with the given name to the stream. This method does not encode the Registry name to the packet, only the id.
      Parameters:
      registry - The registry that owns entry.
      entry - The name of the registry object to write.
      Returns:
      The same stream.
    • writeRegistryId

      public <T> PacketCustom writeRegistryId(net.minecraft.core.Registry<T> registry, T entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes the given object to the stream encoding both the registry name and object's id.
      Parameters:
      registry - The registry that owns entry.
      entry - The object to write to the stream.
      Returns:
      The same stream.
    • writeRegistryId

      public <T> PacketCustom writeRegistryId(net.minecraft.core.Registry<T> registry, net.minecraft.resources.Identifier entry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes the id associated with the given name to the stream encoding both the registry name and object's id.
      Parameters:
      registry - The registry that owns entry.
      entry - The name of the registry object to write.
      Returns:
      The same stream.
    • writeByteBuf

      public PacketCustom writeByteBuf(io.netty.buffer.ByteBuf buf)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Writes a ByteBuf to the stream, including its length. First writes the arrays length as a varInt, followed by the ByteBuf data.
      Parameters:
      buf - The ByteBuf.
      Returns:
      The same stream.
    • append

      public PacketCustom append(io.netty.buffer.ByteBuf buf)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MCDataOutput
      Appends a ByteBuf to the end of this stream.
      Parameters:
      buf - The ByteBuf to append.
      Returns:
      The same stream.