Class LegacyTextFormat
Namespace: Void.Minecraft.Components.Text.Formats
Assembly: Void.Minecraft.dll
Describes a legacy Minecraft text formatting control code.
public record LegacyTextFormat : IEquatable<LegacyTextFormat>Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
LegacyTextFormat(char, string)
Creates and registers a legacy text format.
public LegacyTextFormat(char code, string name)Parameters
code char
The character following the legacy section-sign prefix.
name string
The canonical format or color name.
Remarks
Unknown codes produce a transform that resets formatting to
Properties
Aqua
The legacy text format for aqua, identified by the b control code.
public static LegacyTextFormat Aqua { get; }Property Value
Black
Gets the black color format, identified by code 0.
public static LegacyTextFormat Black { get; }Property Value
Blue
Gets the blue color format, identified by code 9.
public static LegacyTextFormat Blue { get; }Property Value
Bold
Gets the bold format, identified by code l.
public static LegacyTextFormat Bold { get; }Property Value
Code
Gets the character following the legacy section-sign prefix.
public char Code { get; }Property Value
DarkAqua
Gets the dark aqua color format, identified by code 3.
public static LegacyTextFormat DarkAqua { get; }Property Value
DarkBlue
Gets the dark blue color format, identified by code 1.
public static LegacyTextFormat DarkBlue { get; }Property Value
DarkGray
Gets the dark gray color format, identified by code 8.
public static LegacyTextFormat DarkGray { get; }Property Value
DarkGreen
Gets the dark green color format, identified by code 2.
public static LegacyTextFormat DarkGreen { get; }Property Value
DarkPurple
Gets the dark purple color format, identified by code 5.
public static LegacyTextFormat DarkPurple { get; }Property Value
DarkRed
Gets the dark red color format, identified by code 4.
public static LegacyTextFormat DarkRed { get; }Property Value
Gold
Gets the gold color format, identified by code 6.
public static LegacyTextFormat Gold { get; }Property Value
Gray
Gets the gray color format, identified by code 7.
public static LegacyTextFormat Gray { get; }Property Value
Green
Gets the green color format, identified by code a.
public static LegacyTextFormat Green { get; }Property Value
Italic
Gets the italic format, identified by code o.
public static LegacyTextFormat Italic { get; }Property Value
LightPurple
Gets the light purple color format, identified by code d.
public static LegacyTextFormat LightPurple { get; }Property Value
Name
Gets the canonical format name.
public string Name { get; }Property Value
Obfuscated
Gets the obfuscated-text format, identified by code k.
public static LegacyTextFormat Obfuscated { get; }Property Value
Red
Gets the red color format, identified by code c.
public static LegacyTextFormat Red { get; }Property Value
Reset
Gets the reset format, identified by code r.
public static LegacyTextFormat Reset { get; }Property Value
Strikethrough
Gets the strikethrough format, identified by code m.
public static LegacyTextFormat Strikethrough { get; }Property Value
Transform
Gets the operation that applies this format to existing formatting.
public Func<Formatting, Formatting> Transform { get; }Property Value
Underlined
Gets the underlined format, identified by code n.
public static LegacyTextFormat Underlined { get; }Property Value
White
Gets the white color format, identified by code f.
public static LegacyTextFormat White { get; }Property Value
Yellow
Gets the yellow color format, identified by code e.
public static LegacyTextFormat Yellow { get; }Property Value
Methods
TryFromCode(char, out LegacyTextFormat)
Finds a registered legacy format by its control-code character.
public static bool TryFromCode(char code, out LegacyTextFormat result)Parameters
code char
The character following the section-sign prefix.
result LegacyTextFormat
The matching format when found; otherwise null.
Returns
true when a matching format is registered; otherwise false.
TryFromName(ReadOnlySpan<char>, out LegacyTextFormat)
Finds a registered legacy format by its case-sensitive canonical name.
public static bool TryFromName(ReadOnlySpan<char> name, out LegacyTextFormat result)Parameters
name ReadOnlySpan<char>
The name to match.
result LegacyTextFormat
The matching format when found; otherwise null.