Skip to content

Class ComponentNbtTransformers

Namespace: Void.Minecraft.Components.Text.Transformers
Assembly: Void.Minecraft.dll

Applies version-specific schema migrations to NBT text components.

public static class ComponentNbtTransformers

Inheritance

objectComponentNbtTransformers

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

Apply(IMinecraftBinaryPacketWrapper, ProtocolVersion, ProtocolVersion)

Reads, migrates, and rewrites one NBT component property using the naming convention required by the endpoint versions.

[Obsolete("Rewrite properties yourself instead.")]
public static void Apply(IMinecraftBinaryPacketWrapper wrapper, ProtocolVersion from, ProtocolVersion to)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

from ProtocolVersion

The source protocol version.

to ProtocolVersion

The destination protocol version.

Apply(NamedNbtProperty, ProtocolVersion, ProtocolVersion)

Migrates the tag contained in a named NBT property.

[Obsolete("Rewrite properties yourself instead.")]
public static NamedNbtProperty Apply(NamedNbtProperty property, ProtocolVersion from, ProtocolVersion to)

Parameters

property NamedNbtProperty

The source property.

from ProtocolVersion

The source protocol version.

to ProtocolVersion

The destination protocol version.

Returns

NamedNbtProperty

A named property containing the migrated tag.

Apply(NbtProperty, ProtocolVersion, ProtocolVersion)

Migrates the tag contained in an unnamed NBT property.

[Obsolete("Rewrite properties yourself instead.")]
public static NbtProperty Apply(NbtProperty property, ProtocolVersion from, ProtocolVersion to)

Parameters

property NbtProperty

The source property.

from ProtocolVersion

The source protocol version.

to ProtocolVersion

The destination protocol version.

Returns

NbtProperty

An unnamed property containing the migrated tag.

Apply(NbtTag, ProtocolVersion, ProtocolVersion)

Applies every component-schema transition crossed by a protocol-version change.

[Obsolete("Rewrite properties yourself instead.")]
public static NbtTag Apply(NbtTag tag, ProtocolVersion from, ProtocolVersion to)

Parameters

tag NbtTag

The component tag. Compound graphs may be mutated in place.

from ProtocolVersion

The source protocol version.

to ProtocolVersion

The destination protocol version.

Returns

NbtTag

The migrated tag. JSON stored in a string tag is migrated when it can be parsed.

Downgrade_v1_12_to_v1_11_1(NbtTag)

Restores marked achievement hover events when downgrading to 1.11.1.

public static NbtTag Downgrade_v1_12_to_v1_11_1(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Downgrade_v1_16_to_v1_15_2(NbtTag)

Downsamples colors and converts hover contents to values for 1.15.2.

public static NbtTag Downgrade_v1_16_to_v1_15_2(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag; compact string components are expanded to compounds.

Downgrade_v1_20_3_to_v1_20_2(NbtTag)

Converts entity-hover UUID integer arrays to strings for 1.20.2.

public static NbtTag Downgrade_v1_20_3_to_v1_20_2(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Exceptions

NotSupportedException

An entity-hover identifier is neither an integer array nor a string.

Downgrade_v1_21_5_to_v1_21_4(NbtTag)

Converts snake-case 1.21.5 interaction fields to the nested 1.21.4 component schema.

public static NbtTag Downgrade_v1_21_5_to_v1_21_4(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Downgrade_v1_9_to_v1_8(NbtTag)

Converts structured legacy hover values to scalar values for 1.8.

public static NbtTag Downgrade_v1_9_to_v1_8(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Exceptions

NotSupportedException

A supported structured hover action has no text value.

Passthrough_v1_11_1_to_v1_12(IMinecraftBinaryPacketWrapper)

Reads, upgrades, and rewrites one NBT component property from 1.11.1 to 1.12 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_11_1_to_v1_12(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_12_to_v1_11_1(IMinecraftBinaryPacketWrapper)

Reads, downgrades, and rewrites one NBT component property from 1.12 to 1.11.1 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_12_to_v1_11_1(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_15_2_to_v1_16(IMinecraftBinaryPacketWrapper)

Reads, upgrades, and rewrites one NBT component property from 1.15.2 to 1.16 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_15_2_to_v1_16(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_16_to_v1_15_2(IMinecraftBinaryPacketWrapper)

Reads, downgrades, and rewrites one NBT component property from 1.16 to 1.15.2 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_16_to_v1_15_2(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_20_2_to_v1_20_3(IMinecraftBinaryPacketWrapper)

Reads, upgrades, and rewrites one NBT component property from 1.20.2 to 1.20.3 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_20_2_to_v1_20_3(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_20_3_to_v1_20_2(IMinecraftBinaryPacketWrapper)

Reads, downgrades, and rewrites one NBT component property from 1.20.3 to 1.20.2 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_20_3_to_v1_20_2(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_21_4_to_v1_21_5(IMinecraftBinaryPacketWrapper)

Reads, upgrades, and rewrites one NBT component property from 1.21.4 to 1.21.5 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_21_4_to_v1_21_5(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_21_5_to_v1_21_4(IMinecraftBinaryPacketWrapper)

Reads, downgrades, and rewrites one NBT component property from 1.21.5 to 1.21.4 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_21_5_to_v1_21_4(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_8_to_v1_9(IMinecraftBinaryPacketWrapper)

Reads, upgrades, and rewrites one NBT component property from 1.8 to 1.9 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_8_to_v1_9(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Passthrough_v1_9_to_v1_8(IMinecraftBinaryPacketWrapper)

Reads, downgrades, and rewrites one NBT component property from 1.9 to 1.8 format.

[Obsolete("Rewrite properties yourself instead.")]
public static void Passthrough_v1_9_to_v1_8(IMinecraftBinaryPacketWrapper wrapper)

Parameters

wrapper IMinecraftBinaryPacketWrapper

The packet wrapper whose cursor is advanced by one property.

Upgrade_v1_11_1_to_v1_12(NbtTag)

Converts achievement hover events to marked text hover events for 1.12.

public static NbtTag Upgrade_v1_11_1_to_v1_12(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Upgrade_v1_15_2_to_v1_16(NbtTag)

Upgrades hover values and compact strings to the 1.16 NBT component schema.

public static NbtTag Upgrade_v1_15_2_to_v1_16(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Exceptions

NotSupportedException

An item or entity hover value has no SNBT text field.

Upgrade_v1_20_2_to_v1_20_3(NbtTag)

Applies the component representation transition from 1.20.2 to 1.20.3.

public static NbtTag Upgrade_v1_20_2_to_v1_20_3(NbtTag tag)

Parameters

tag NbtTag

The component tag to migrate.

Returns

NbtTag

The migrated tag.

Upgrade_v1_21_4_to_v1_21_5(NbtTag)

Converts nested 1.21.4 interaction fields to the flattened snake-case 1.21.5 schema.

public static NbtTag Upgrade_v1_21_4_to_v1_21_5(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.

Upgrade_v1_8_to_v1_9(NbtTag)

Wraps supported scalar hover values in text compounds for 1.9.

public static NbtTag Upgrade_v1_8_to_v1_9(NbtTag tag)

Parameters

tag NbtTag

The component tag to mutate recursively.

Returns

NbtTag

The migrated tag.