Skip to content

API reference Obsidian.API.Inventory.DataComponents

IdSet record struct

A set of a registry's entries, like vanilla's HolderSet stream codec: a tag, or ids that a connection may number differently (INetStreamReader.ReadRegistryId).

public readonly record struct IdSet : INetworkSerializable<IdSet>, IEquatable<IdSet>

In Obsidian.API.

Properties

Ids

public ImmutableArray<int>? Ids { get; init; }

An array of registry IDs. Only present if Type is not 0. The size of the array is equal to Type - 1.

TagName

public string TagName { get; init; }

The registry tag defining the ID set. Only present if Type is 0.

Type

public required int Type { get; init; }

Value used to determine the data that follows. It can be either:

  • 0 - Represents a named set of IDs defined by a tag.
  • Anything else - Represents an ad-hoc set of IDs enumerated inline.

Methods

public bool Equals(IdSet other);public override int GetHashCode();

Read(INetStreamReader)

public static IdSet Read(INetStreamReader reader);

Reads a set without translating its ids.

Read(INetStreamReader, string)

public static IdSet Read(INetStreamReader reader, string registry);

Reads a set of the registry registry, e.g. minecraft:block.

Write(IdSet, INetStreamWriter)

public static void Write(IdSet value, INetStreamWriter writer);

Writes a set without translating its ids.

Write(IdSet, INetStreamWriter, string)

public static void Write(IdSet value, INetStreamWriter writer, string registry);

Writes a set of the registry registry, e.g. minecraft:block.

On this page