INetStreamWriter interface
public interface INetStreamWriter : INetStream, IDisposable, IAsyncDisposable
In Obsidian.API.
Properties
bool CanWrite { get; }Methods
byte[] ToArray();void Write(INetStream buffer);void WriteAbsoluteFloatPosition(Vector value);void WriteAbsoluteFloatPositionF(VectorF value);void WriteAbsoluteShortPosition(Vector value);void WriteAbsoluteShortPosition(VectorF value);void WriteAdvancement(Advancement advancement);void WriteAttributeModifier(AttributeModifier attribute);void WriteBitSet(BitSet bitset, bool isFixed = false);void WriteBoolean(bool value);void WriteByte(byte value);void WriteByte(Enum value);void WriteByte(sbyte value);void WriteByteArray(byte[] values);void WriteByteArray(ReadOnlySpan<byte> values);void WriteChat(ChatMessage chatMessage);void WriteCodec(ICodec codec);void WriteDataComponent(DataComponent component);void WriteDateTimeOffset(DateTimeOffset date);void WriteDouble(double value);void WriteEnchantment(Enchantment enchantment);void WriteEntity(IEntity entity);void WriteEntityMetadataType(byte index, EntityMetadataType type);void WriteFixedBitSet(BitSet bits, int size);void WriteHashedItemStack(IHashedItemStack itemStack);void WriteHashedItemStack(ItemStack itemStack);void WriteInt(Enum value);void WriteInt(int value);void WriteItemStack(ItemStack itemStack);void WriteItemStackList(params ReadOnlySpan<ItemStack> values);WriteItemStackTemplate(ItemStack)
void WriteItemStackTemplate(ItemStack itemStack);Writes a nonempty item template (item ID, count, component patch), used by nested components.
void WriteLengthPrefixedArray(bool showInTooltips, params Enchantment[] enchantments);void WriteLengthPrefixedArray<TValue>(Action<TValue> write, params ReadOnlySpan<TValue> values);void WriteLong(long value);void WriteLongArray(long[] values);WriteMerchantOffer(TradeEntry)
void WriteMerchantOffer(TradeEntry value);Writes a villager trade like vanilla's MerchantOffer stream codec.
WriteNbtCompound(NbtCompound)
void WriteNbtCompound(NbtCompound compound);Writes a compound as network NBT (no root name), the encoding of components vanilla doesn't sync with a dedicated codec, such as minecraft:map_decorations.
void WriteOptional(bool? value);void WriteOptional(byte? value);void WriteOptional(double? value);void WriteOptional(Enum value);void WriteOptional(float? value);void WriteOptional(Guid? value);void WriteOptional(int? value);void WriteOptional(short? value);void WriteOptional(string value);void WriteOptional<TValue>(TValue value) where TValue : INetworkSerializable<TValue>;void WriteOptional<TValue>(TValue? value) where TValue : struct, INetworkSerializable<TValue>;void WriteOptionalNbtCompound(NbtCompound compound);void WritePacket(IClientboundPacket packet);void WritePosition(SoundPosition position);void WritePosition(Vector value);void WritePositionF(VectorF value);WriteRegistryHolder(string, int?)
void WriteRegistryHolder(string registry, int? id);Writes a holder like vanilla's ByteBufCodecs.holder: the registry id id (see INetStreamWriter.WriteRegistryId), or, if null, the marker of a value the caller writes inline next.
WriteRegistryId(string, int)
void WriteRegistryId(string registry, int id);Writes this process's id id of the built-in registry registry (e.g. minecraft:block), in the connection's numbering where it numbers the registry differently. The default implementation, for streams that don't translate ids, writes it as it is.
void WriteRequiredItemStack(ItemStack itemStack);void WriteShort(short value);void WriteSingle(float value);void WriteSkinProperty(SkinProperty skinProperty);void WriteSoundEffect(SoundEffect sound);void WriteSoundEvent(SoundEvent soundEvent);void WriteString(string value, int maxLength = 32767);void WriteUnsignedShort(ushort value);void WriteUntrustedItemStack(ItemStack itemStack);void WriteUuid(Guid value);void WriteVarInt(Enum value);void WriteVarInt(int value);void WriteVarLong(long value);void WriteVelocity(Velocity value);