Package codechicken.lib.data
Interface MCDataInput
- All Known Implementing Classes:
MCDataByteBuf,MCDataInputStream,PacketCustom
Deprecated, for removal: This API element is subject to removal in a future version.
Provides the ability to read various datas from some sort of data stream.
See
MCDataInputStream to wrap an InputStream to this.
See MCByteStream to wrap an ByteBuf to this.
Created by covers1624 on 4/15/20.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classDeprecated, for removal: This API element is subject to removal in a future version.Simple wrapper to anInputStream. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.Reads a boolean from the stream.default boolean[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of booleans written with,MCDataOutput.writeBooleans(boolean[]), orMCDataOutput.writeBooleans(boolean[], int, int)bytereadByte()Deprecated, for removal: This API element is subject to removal in a future version.Reads a byte from the stream.default io.netty.buffer.ByteBufDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int),MCDataOutput.writeByteBuffer(ByteBuffer), orMCDataOutput.writeByteBuf(ByteBuf)default ByteBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int),MCDataOutput.writeByteBuffer(ByteBuffer), orMCDataOutput.writeByteBuf(ByteBuf)default byte[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int), orMCDataOutput.writeByteBuffer(ByteBuffer)charreadChar()Deprecated, for removal: This API element is subject to removal in a future version.Reads a char from the stream.default CharBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of chars written with,MCDataOutput.writeChars(char[]),MCDataOutput.writeChars(char[], int, int), orMCDataOutput.writeCharBuffer(CharBuffer)default char[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of chars written with,MCDataOutput.writeChars(char[]),MCDataOutput.writeChars(char[], int, int), orMCDataOutput.writeCharBuffer(CharBuffer)default net.minecraft.nbt.CompoundTagDeprecated, for removal: This API element is subject to removal in a future version.Reads aCompoundTagfrom the stream.default Cuboid6Deprecated, for removal: This API element is subject to removal in a future version.Reads aCuboid6from the stream.default net.minecraft.core.DirectionDeprecated, for removal: This API element is subject to removal in a future version.Reads aDirectionfrom the stream.doubleDeprecated, for removal: This API element is subject to removal in a future version.Reads a double from the stream.default DoubleBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of doubles written with,MCDataOutput.writeDoubles(double[]),MCDataOutput.writeDoubles(double[], int, int), orMCDataOutput.writeDoubleBuffer(DoubleBuffer).default double[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of doubles written with,MCDataOutput.writeDoubles(double[]),MCDataOutput.writeDoubles(double[], int, int), orMCDataOutput.writeDoubleBuffer(DoubleBuffer).default <T extends Enum<T>>
TDeprecated, for removal: This API element is subject to removal in a future version.Reads anEnumvalue from the stream.floatDeprecated, for removal: This API element is subject to removal in a future version.Reads a float from the stream.default FloatBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of floats written with,MCDataOutput.writeFloats(float[]),MCDataOutput.writeFloats(float[], int, int), orMCDataOutput.writeFloatBuffer(FloatBuffer).default float[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of floats written with,MCDataOutput.writeFloats(float[]),MCDataOutput.writeFloats(float[], int, int), orMCDataOutput.writeFloatBuffer(FloatBuffer).default net.neoforged.neoforge.fluids.FluidStackDeprecated, for removal: This API element is subject to removal in a future version.Reads aFluidStackfrom the stream.intreadInt()Deprecated, for removal: This API element is subject to removal in a future version.Reads an int from the stream.default IntBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of ints written with,MCDataOutput.writeInts(int[]),MCDataOutput.writeInts(int[], int, int), orMCDataOutput.writeIntBuffer(IntBuffer).default int[]readInts()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of ints written with,MCDataOutput.writeInts(int[]),MCDataOutput.writeInts(int[], int, int), orMCDataOutput.writeIntBuffer(IntBuffer).default net.minecraft.world.item.ItemStackDeprecated, for removal: This API element is subject to removal in a future version.Reads anItemStackfrom the stream.longreadLong()Deprecated, for removal: This API element is subject to removal in a future version.Reads a long from the stream.default LongBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of longs written with,MCDataOutput.writeLongs(long[]),MCDataOutput.writeLongs(long[], int, int), orMCDataOutput.writeLongBuffer(LongBuffer).default long[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of longs written with,MCDataOutput.writeLongs(long[]),MCDataOutput.writeLongs(long[], int, int), orMCDataOutput.writeLongBuffer(LongBuffer).default @Nullable net.minecraft.nbt.CompoundTagDeprecated, for removal: This API element is subject to removal in a future version.Reads aCompoundTagfrom the stream.default net.minecraft.core.BlockPosreadPos()Deprecated, for removal: This API element is subject to removal in a future version.Reads aBlockPosfrom the stream.default <T> TDeprecated, for removal: This API element is subject to removal in a future version.Reads a registry object from the stream.default <T> TreadRegistryIdDirect(net.minecraft.core.Registry<T> registry) Deprecated, for removal: This API element is subject to removal in a future version.Reads a registry object from the stream.default net.minecraft.resources.IdentifierDeprecated, for removal: This API element is subject to removal in a future version.Reads aIdentifierfrom the stream.shortDeprecated, for removal: This API element is subject to removal in a future version.Reads a Short from the stream.default ShortBufferDeprecated, for removal: This API element is subject to removal in a future version.Reads a block of shorts written with,MCDataOutput.writeShorts(short[]),MCDataOutput.writeShorts(short[], int, int), orMCDataOutput.writeShortBuffer(ShortBuffer).default short[]Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of shorts written with,MCDataOutput.writeShorts(short[]),MCDataOutput.writeShorts(short[], int, int), orMCDataOutput.writeShortBuffer(ShortBuffer).default intDeprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length signed int.default int[]Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length Signed ints from the stream.default longDeprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length signed long.default long[]Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length Signed longs from the stream.default StringDeprecated, for removal: This API element is subject to removal in a future version.Reads a UTF-8 encodedStringfrom the stream.default net.minecraft.network.chat.ComponentDeprecated, for removal: This API element is subject to removal in a future version.Reads anComponentfrom the stream.shortDeprecated, for removal: This API element is subject to removal in a future version.Reads an Unsigned byte from the stream.intDeprecated, for removal: This API element is subject to removal in a future version.Reads an Unsigned short from the stream.default UUIDreadUUID()Deprecated, for removal: This API element is subject to removal in a future version.Reads aUUIDfrom the stream.default intDeprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length int from the stream.default int[]Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length ints from the stream.default longDeprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length long from the stream.default long[]Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length longs from the stream.default net.minecraft.world.phys.Vec3Deprecated, for removal: This API element is subject to removal in a future version.Reads aVec3from the stream.default org.joml.Vector3fDeprecated, for removal: This API element is subject to removal in a future version.Reads aVector3ffrom the stream.default net.minecraft.core.Vec3iDeprecated, for removal: This API element is subject to removal in a future version.Reads aVec3ifrom the stream.default Vector3Deprecated, for removal: This API element is subject to removal in a future version.Reads aVector3from the stream.default <T> TreadWithCodec(net.minecraft.network.codec.StreamDecoder<? super net.minecraft.network.FriendlyByteBuf, T> codec) Deprecated, for removal: This API element is subject to removal in a future version.default <T> TreadWithRegistryCodec(net.minecraft.network.codec.StreamDecoder<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec) Deprecated, for removal: This API element is subject to removal in a future version.default DataInputDeprecated, for removal: This API element is subject to removal in a future version.Wraps this stream into aDataInputstream.default InputStreamDeprecated, for removal: This API element is subject to removal in a future version.Wraps this stream into anInputStream.
-
Method Details
-
readByte
byte readByte()Deprecated, for removal: This API element is subject to removal in a future version.Reads a byte from the stream.- Returns:
- The byte.
-
readUByte
short readUByte()Deprecated, for removal: This API element is subject to removal in a future version.Reads an Unsigned byte from the stream.- Returns:
- The Unsigned byte.
-
readChar
char readChar()Deprecated, for removal: This API element is subject to removal in a future version.Reads a char from the stream.- Returns:
- The char.
-
readShort
short readShort()Deprecated, for removal: This API element is subject to removal in a future version.Reads a Short from the stream.- Returns:
- The short.
-
readUShort
int readUShort()Deprecated, for removal: This API element is subject to removal in a future version.Reads an Unsigned short from the stream.- Returns:
- The Unsigned short.
-
readInt
int readInt()Deprecated, for removal: This API element is subject to removal in a future version.Reads an int from the stream.- Returns:
- The int.
-
readLong
long readLong()Deprecated, for removal: This API element is subject to removal in a future version.Reads a long from the stream.- Returns:
- The long.
-
readFloat
float readFloat()Deprecated, for removal: This API element is subject to removal in a future version.Reads a float from the stream.- Returns:
- The float.
-
readDouble
double readDouble()Deprecated, for removal: This API element is subject to removal in a future version.Reads a double from the stream.- Returns:
- The double.
-
readBoolean
boolean readBoolean()Deprecated, for removal: This API element is subject to removal in a future version.Reads a boolean from the stream.- Returns:
- The boolean.
-
readBytes
default byte[] readBytes()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int), orMCDataOutput.writeByteBuffer(ByteBuffer)- Returns:
- The bytes.
-
readChars
default char[] readChars()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of chars written with,MCDataOutput.writeChars(char[]),MCDataOutput.writeChars(char[], int, int), orMCDataOutput.writeCharBuffer(CharBuffer)- Returns:
- The chars.
-
readShorts
default short[] readShorts()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of shorts written with,MCDataOutput.writeShorts(short[]),MCDataOutput.writeShorts(short[], int, int), orMCDataOutput.writeShortBuffer(ShortBuffer).- Returns:
- The shorts.
-
readInts
default int[] readInts()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of ints written with,MCDataOutput.writeInts(int[]),MCDataOutput.writeInts(int[], int, int), orMCDataOutput.writeIntBuffer(IntBuffer).- Returns:
- The ints.
-
readLongs
default long[] readLongs()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of longs written with,MCDataOutput.writeLongs(long[]),MCDataOutput.writeLongs(long[], int, int), orMCDataOutput.writeLongBuffer(LongBuffer).- Returns:
- The longs.
-
readFloats
default float[] readFloats()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of floats written with,MCDataOutput.writeFloats(float[]),MCDataOutput.writeFloats(float[], int, int), orMCDataOutput.writeFloatBuffer(FloatBuffer).- Returns:
- The floats.
-
readDoubles
default double[] readDoubles()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of doubles written with,MCDataOutput.writeDoubles(double[]),MCDataOutput.writeDoubles(double[], int, int), orMCDataOutput.writeDoubleBuffer(DoubleBuffer).- Returns:
- The doubles.
-
readBooleans
default boolean[] readBooleans()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of booleans written with,MCDataOutput.writeBooleans(boolean[]), orMCDataOutput.writeBooleans(boolean[], int, int)- Returns:
- The booleans.
-
readVarInt
default int readVarInt()Deprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length int from the stream.- Returns:
- The int.
-
readVarLong
default long readVarLong()Deprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length long from the stream.- Returns:
- The long.
-
readSignedVarInt
default int readSignedVarInt()Deprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length signed int.- Returns:
- The int.
- See Also:
-
readSignedVarLong
default long readSignedVarLong()Deprecated, for removal: This API element is subject to removal in a future version.Reads a Variable length signed long.- Returns:
- The long.
- See Also:
-
readVarInts
default int[] readVarInts()Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length ints from the stream.- Returns:
- The ints.
-
readVarLongs
default long[] readVarLongs()Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length longs from the stream.- Returns:
- The longs.
-
readSignedVarInts
default int[] readSignedVarInts()Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length Signed ints from the stream.- Returns:
- The ints.
-
readSignedVarLongs
default long[] readSignedVarLongs()Deprecated, for removal: This API element is subject to removal in a future version.Reads an array of Variable length Signed longs from the stream.- Returns:
- The longs.
-
readString
Deprecated, for removal: This API element is subject to removal in a future version.Reads a UTF-8 encodedStringfrom the stream.- Returns:
- The
String.
-
readUUID
Deprecated, for removal: This API element is subject to removal in a future version.Reads aUUIDfrom the stream.- Returns:
- The
UUID.
-
readEnum
Deprecated, for removal: This API element is subject to removal in a future version.Reads anEnumvalue from the stream.- Parameters:
clazz- The Class of the enum.- Returns:
- The
Enumvalue.
-
readByteBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int),MCDataOutput.writeByteBuffer(ByteBuffer), orMCDataOutput.writeByteBuf(ByteBuf)- Returns:
- The bytes.
-
readCharBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of chars written with,MCDataOutput.writeChars(char[]),MCDataOutput.writeChars(char[], int, int), orMCDataOutput.writeCharBuffer(CharBuffer)- Returns:
- The chars.
-
readShortBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of shorts written with,MCDataOutput.writeShorts(short[]),MCDataOutput.writeShorts(short[], int, int), orMCDataOutput.writeShortBuffer(ShortBuffer).- Returns:
- The shorts.
-
readIntBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of ints written with,MCDataOutput.writeInts(int[]),MCDataOutput.writeInts(int[], int, int), orMCDataOutput.writeIntBuffer(IntBuffer).- Returns:
- The ints.
-
readLongBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of longs written with,MCDataOutput.writeLongs(long[]),MCDataOutput.writeLongs(long[], int, int), orMCDataOutput.writeLongBuffer(LongBuffer).- Returns:
- The longs.
-
readFloatBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of floats written with,MCDataOutput.writeFloats(float[]),MCDataOutput.writeFloats(float[], int, int), orMCDataOutput.writeFloatBuffer(FloatBuffer).- Returns:
- The floats.
-
readDoubleBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of doubles written with,MCDataOutput.writeDoubles(double[]),MCDataOutput.writeDoubles(double[], int, int), orMCDataOutput.writeDoubleBuffer(DoubleBuffer).- Returns:
- The doubles.
-
readVector
Deprecated, for removal: This API element is subject to removal in a future version.Reads aVector3from the stream.- Returns:
- The
Vector3.
-
readCuboid
Deprecated, for removal: This API element is subject to removal in a future version.Reads aCuboid6from the stream.- Returns:
- The
Cuboid6.
-
readResourceLocation
default net.minecraft.resources.Identifier readResourceLocation()Deprecated, for removal: This API element is subject to removal in a future version.Reads aIdentifierfrom the stream.- Returns:
- The
Identifier.
-
readDirection
default net.minecraft.core.Direction readDirection()Deprecated, for removal: This API element is subject to removal in a future version.Reads aDirectionfrom the stream.- Returns:
- The
Direction.
-
readPos
default net.minecraft.core.BlockPos readPos()Deprecated, for removal: This API element is subject to removal in a future version.Reads aBlockPosfrom the stream.- Returns:
- The
BlockPos.
-
readVec3i
default net.minecraft.core.Vec3i readVec3i()Deprecated, for removal: This API element is subject to removal in a future version.Reads aVec3ifrom the stream.- Returns:
- The
Vec3i.
-
readVec3d
default net.minecraft.world.phys.Vec3 readVec3d()Deprecated, for removal: This API element is subject to removal in a future version.Reads aVec3from the stream.- Returns:
- The
Vec3.
-
readVec3f
default org.joml.Vector3f readVec3f()Deprecated, for removal: This API element is subject to removal in a future version.Reads aVector3ffrom the stream.- Returns:
- The
Vector3f.
-
readCompoundNBT
default net.minecraft.nbt.CompoundTag readCompoundNBT()Deprecated, for removal: This API element is subject to removal in a future version.Reads aCompoundTagfrom the stream.- Returns:
- The
CompoundTag.
-
readNullableCompoundNBT
@Nullable default @Nullable net.minecraft.nbt.CompoundTag readNullableCompoundNBT()Deprecated, for removal: This API element is subject to removal in a future version.Reads aCompoundTagfrom the stream.- Returns:
- The
CompoundTagornull.
-
readItemStack
default net.minecraft.world.item.ItemStack readItemStack()Deprecated, for removal: This API element is subject to removal in a future version.Reads anItemStackfrom the stream. It should also be noted that this implementation reads theItemStack.getCount()as a varInt opposed to a byte, as that is favourable in some cases.- Returns:
- The
ItemStack.
-
readFluidStack
default net.neoforged.neoforge.fluids.FluidStack readFluidStack()Deprecated, for removal: This API element is subject to removal in a future version.Reads aFluidStackfrom the stream.- Returns:
- The
FluidStack.
-
readTextComponent
default net.minecraft.network.chat.Component readTextComponent()Deprecated, for removal: This API element is subject to removal in a future version.Reads anComponentfrom the stream.- Returns:
- The
Component.
-
readRegistryIdDirect
default <T> T readRegistryIdDirect(net.minecraft.core.Registry<T> registry) Deprecated, for removal: This API element is subject to removal in a future version.Reads a registry object from the stream.- Parameters:
registry- TheRegistryto load the entry from.- Returns:
- The registry object..
- See Also:
-
readRegistryId
default <T> T readRegistryId()Deprecated, for removal: This API element is subject to removal in a future version.Reads a registry object from the stream.- Returns:
- The registry object.
- See Also:
-
readWithCodec
default <T> T readWithCodec(net.minecraft.network.codec.StreamDecoder<? super net.minecraft.network.FriendlyByteBuf, T> codec) Deprecated, for removal: This API element is subject to removal in a future version. -
readWithRegistryCodec
default <T> T readWithRegistryCodec(net.minecraft.network.codec.StreamDecoder<? super net.minecraft.network.RegistryFriendlyByteBuf, T> codec) Deprecated, for removal: This API element is subject to removal in a future version. -
readByteBuf
default io.netty.buffer.ByteBuf readByteBuf()Deprecated, for removal: This API element is subject to removal in a future version.Reads a block of bytes written with,MCDataOutput.writeBytes(byte[]),MCDataOutput.writeBytes(byte[], int, int),MCDataOutput.writeByteBuffer(ByteBuffer), orMCDataOutput.writeByteBuf(ByteBuf)- Returns:
- The bytes.
-
toDataInput
Deprecated, for removal: This API element is subject to removal in a future version.Wraps this stream into aDataInputstream. any data read from the returnedDataInputis read from this stream.- Returns:
- The
DataInput.
-
toInputStream
Deprecated, for removal: This API element is subject to removal in a future version.Wraps this stream into anInputStream. any data read from the returnedInputStreamis read from this stream.- Returns:
- The
InputStream.
-