Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - AnsiComponentSerializer #140

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions text-serializer-ansi/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
jar {
manifest.attributes(
'Automatic-Module-Name': 'net.kyori.adventure.text.serializer.ansi'
)
}

dependencies {
Narimm marked this conversation as resolved.
Show resolved Hide resolved
api project(':adventure-api')
api 'org.fusesource.jansi:jansi:1.18'
Narimm marked this conversation as resolved.
Show resolved Hide resolved

}

jar {
manifest.attributes(
'Automatic-Module-Name': 'net.kyori.adventure.text.serializer.ansi'
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum Formats {
YELLOW(NamedTextColor.YELLOW, Ansi.ansi().fgBright(Ansi.Color.YELLOW), false, "yellow"),
WHITE(NamedTextColor.WHITE, Ansi.ansi().fgBright(Ansi.Color.WHITE), false, "white"),

MAGIC(TextDecoration.OBFUSCATED, Ansi.ansi().a(Ansi.Attribute.BLINK_SLOW), true, "magic"),
Narimm marked this conversation as resolved.
Show resolved Hide resolved
OBFUSCATED(TextDecoration.OBFUSCATED, Ansi.ansi().a(Ansi.Attribute.BLINK_SLOW), true, "obfuscated"),
BOLD(TextDecoration.BOLD, Ansi.ansi().a(Ansi.Attribute.UNDERLINE_DOUBLE), true, "bold"),
STRIKETHROUGH(TextDecoration.STRIKETHROUGH, Ansi.ansi().a(Ansi.Attribute.STRIKETHROUGH_ON), true, "strikethrough", "strike"),
UNDERLINE(TextDecoration.UNDERLINED, Ansi.ansi().a(Ansi.Attribute.UNDERLINE), true, "underline"),
Expand All @@ -74,8 +74,8 @@ enum Formats {
}
}

Formats(final TextFormat c, final Ansi ansi, final boolean isFormat, final String... names) {
this.format = c;
Formats(final TextFormat textFormat, final Ansi ansi, final boolean isFormat, final String... names) {
this.format = textFormat;
this.escapeString = ansi;
this.mNames = names;
this.mIsFormat = isFormat;
Expand All @@ -98,8 +98,8 @@ public String toString() {
return this.escapeString.toString();
}

public static Formats byFormat(final TextFormat c) {
return mMap.get(c);
public static Formats byFormat(final TextFormat textFormat) {
return mMap.get(textFormat);
}

public static Formats byName(final String name) {
Expand Down