Interface MCDataOutput

All Known Implementing Classes:
MCByteStream, MCDataByteBuf, MCDataOutputStream, PacketCustom

@Deprecated(forRemoval=true) public interface MCDataOutput
Deprecated, for removal: This API element is subject to removal in a future version.
Provides the ability to write various datas to some sort of data stream. See MCDataOutputStream to wrap an OutputStream to this. See MCByteStream to wrap an ByteBuf to this.

Created by covers1624 on 4/15/20.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple wrapper to an OutputStream.
  • Method Summary

    Modifier and Type
    Method
    Description
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default DataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Wraps this stream into a DataOutput stream, any data written into the returned DataOutput is appended to this stream.
    default OutputStream
    Deprecated, for removal: This API element is subject to removal in a future version.
    Wraps this stream into an OutputStream, any data written into the returned OutputStream is appended to this stream.
    writeBoolean(boolean b)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a boolean to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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 b)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a byte to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a ByteBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a CharBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Cuboid6 to the stream.
    default MCDataOutput
    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 d)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a double to the stream.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a DoubleBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a FloatBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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 i)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a int to the stream.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a IntBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a LongBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default <T> MCDataOutput
    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.
    default <T> MCDataOutput
    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.
    default <T> MCDataOutput
    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.
    default <T> MCDataOutput
    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.
    default MCDataOutput
    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 s)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a short to the stream.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a ShortBuffer to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Signed Variable length int.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length Signed ints to the stream.
    default MCDataOutput
    writeSignedVarInts(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 Signed ints to the stream.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Signed Variable length long.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes an array of Variable length Signed longs to the stream.
    default MCDataOutput
    writeSignedVarLongs(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 Signed longs to the stream.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a UTF-8 Encoded String to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a UUID to the stream.
    default MCDataOutput
    writeVarInt(int i)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Variable length int.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    writeVarLong(long l)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Variable length long.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    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.
    default MCDataOutput
    writeVec3f(org.joml.Vector3f vec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Vector3f to the stream.
    default MCDataOutput
    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.
    default MCDataOutput
    Deprecated, for removal: This API element is subject to removal in a future version.
    Writes a Vector3 to the stream.
    default <T> MCDataOutput
    writeWithCodec(net.minecraft.network.codec.StreamEncoder<? super net.minecraft.network.FriendlyByteBuf,T> codec, T thing)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default <T> MCDataOutput
    writeWithRegistryCodec(net.minecraft.network.codec.StreamEncoder<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, T thing)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Details

    • writeByte

      MCDataOutput writeByte(int b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a byte to the stream.
      Parameters:
      b - The byte.
      Returns:
      The same stream.
    • writeChar

      MCDataOutput writeChar(int c)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a char to the stream.
      Parameters:
      c - The char.
      Returns:
      The same stream.
    • writeShort

      MCDataOutput writeShort(int s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a short to the stream.
      Parameters:
      s - The short.
      Returns:
      The same stream.
    • writeInt

      MCDataOutput writeInt(int i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a int to the stream.
      Parameters:
      i - The int.
      Returns:
      The same stream.
    • writeLong

      MCDataOutput writeLong(long l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a long to the stream.
      Parameters:
      l - The long.
      Returns:
      The same stream.
    • writeFloat

      MCDataOutput writeFloat(float f)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a float to the stream.
      Parameters:
      f - The float.
      Returns:
      The same stream.
    • writeDouble

      MCDataOutput writeDouble(double d)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a double to the stream.
      Parameters:
      d - The double.
      Returns:
      The same stream.
    • writeBoolean

      MCDataOutput writeBoolean(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a boolean to the stream.
      Parameters:
      b - The boolean.
      Returns:
      The same stream.
    • writeBytes

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      Returns:
      The same stream.
    • writeBytes

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      c - The array.
      Returns:
      The same stream.
    • writeChars

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      s - The array.
      Returns:
      The same stream.
    • writeShorts

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      Returns:
      The same stream.
    • writeInts

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      Returns:
      The same stream.
    • writeLongs

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      f - The array.
      Returns:
      The same stream.
    • writeFloats

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      d - The array.
      Returns:
      The same stream.
    • writeDoubles

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      b - The array.
      Returns:
      The same stream.
    • writeBooleans

      default MCDataOutput 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. 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

      default MCDataOutput 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.
      Parameters:
      bytes - The array.
      Returns:
      The same stream.
    • writeVarInt

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

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

      default MCDataOutput writeSignedVarInt(int i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a Signed Variable length int. Favourable for numbers <= -1
      Parameters:
      i - The int.
      Returns:
      The same stream.
    • writeSignedVarLong

      default MCDataOutput writeSignedVarLong(long i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a Signed Variable length long. Favourable for numbers <= -1
      Parameters:
      i - The long.
      Returns:
      The same stream.
    • writeVarInts

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      i - The array.
      Returns:
      The same stream.
    • writeVarInts

      default MCDataOutput 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. 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

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the array data.
      Parameters:
      l - The array.
      Returns:
      The same stream.
    • writeVarLongs

      default MCDataOutput 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. 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.
    • writeSignedVarInts

      default MCDataOutput writeSignedVarInts(int[] i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes an array of Variable length Signed 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.
    • writeSignedVarInts

      default MCDataOutput writeSignedVarInts(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 Signed 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.
    • writeSignedVarLongs

      default MCDataOutput writeSignedVarLongs(long[] l)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes an array of Variable length Signed 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.
    • writeSignedVarLongs

      default MCDataOutput writeSignedVarLongs(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 Signed 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

      default MCDataOutput writeString(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      default MCDataOutput 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.
      Parameters:
      s - The String.
      maxLen - The maximum number of bytes to write, extra bytes will cause an EncoderException.
      Returns:
      The same stream.
    • writeUUID

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

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

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

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

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

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

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

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

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

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

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

      default MCDataOutput 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.
      Parameters:
      loc - The Identifier.
      Returns:
      The same stream.
    • writeDirection

      default MCDataOutput 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.
      Parameters:
      dir - The Direction.
      Returns:
      The same stream.
    • writePos

      default MCDataOutput 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.
      Parameters:
      pos - The BlockPos.
      Returns:
      The same stream.
    • writeVec3i

      default MCDataOutput 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.
      Parameters:
      vec - The Vec3i.
      Returns:
      The same stream.
    • writeVec3f

      default MCDataOutput writeVec3f(org.joml.Vector3f vec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Writes a Vector3f to the stream.
      Parameters:
      vec - The Vector3f.
      Returns:
      The same stream.
    • writeVec3d

      default MCDataOutput 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.
      Parameters:
      vec - The Vec3.
      Returns:
      The same stream.
    • writeCompoundNBT

      default MCDataOutput 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.
      Parameters:
      tag - The CompoundTag.
      Returns:
      The same stream.
    • writeNullableCompoundNBT

      default MCDataOutput writeNullableCompoundNBT(@Nullable @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.
      Parameters:
      tag - The CompoundTag or null.
      Returns:
      The same stream.
    • writeItemStack

      default MCDataOutput 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.

      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.
    • writeFluidStack

      default MCDataOutput 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.
      Parameters:
      stack - The FluidStack.
      Returns:
      The same stream.
    • writeTextComponent

      default MCDataOutput 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.
      Parameters:
      component - The Component.
      Returns:
      The same stream.
    • writeRegistryIdDirect

      default <T> MCDataOutput 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. 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

      default <T> MCDataOutput 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. 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

      default <T> MCDataOutput 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.
      Parameters:
      registry - The registry that owns entry.
      entry - The object to write to the stream.
      Returns:
      The same stream.
    • writeRegistryId

      default <T> MCDataOutput 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.
      Parameters:
      registry - The registry that owns entry.
      entry - The name of the registry object to write.
      Returns:
      The same stream.
    • writeWithCodec

      default <T> MCDataOutput writeWithCodec(net.minecraft.network.codec.StreamEncoder<? super net.minecraft.network.FriendlyByteBuf,T> codec, T thing)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • writeWithRegistryCodec

      default <T> MCDataOutput writeWithRegistryCodec(net.minecraft.network.codec.StreamEncoder<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, T thing)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • writeByteBuf

      default MCDataOutput 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. First writes the arrays length as a varInt, followed by the ByteBuf data.
      Parameters:
      buf - The ByteBuf.
      Returns:
      The same stream.
    • append

      default MCDataOutput 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.
      Parameters:
      buf - The ByteBuf to append.
      Returns:
      The same stream.
    • toDataOutput

      default DataOutput toDataOutput()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wraps this stream into a DataOutput stream, any data written into the returned DataOutput is appended to this stream.
      Returns:
      The DataOutput stream.
    • toOutputStream

      default OutputStream toOutputStream()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wraps this stream into an OutputStream, any data written into the returned OutputStream is appended to this stream.
      Returns:
      The OutputStream stream.