Skip to content

Commit

Permalink
Temporarily revert shadow color support
Browse files Browse the repository at this point in the history
Will be un-reverted when adventure v4.18.0 gets released
  • Loading branch information
booky10 committed Dec 10, 2024
1 parent d6c81f3 commit 0be838c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import net.kyori.adventure.text.event.DataComponentValue;
import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.ShadowColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.format.TextDecoration;
Expand Down Expand Up @@ -331,10 +330,11 @@ public AdventureNBTSerializer(boolean downsampleColor) {
if (color != null) style.color(color);
});
if (BackwardCompatUtil.IS_4_18_0_OR_NEWER) {
reader.useUTF("shadow_color", value -> {
ShadowColor color = ShadowColor.fromHexString(value);
if (color != null) style.shadowColor(color);
});
// FIXME adventure v4.18.0
// reader.useUTF("shadow_color", value -> {
// ShadowColor color = ShadowColor.fromHexString(value);
// if (color != null) style.shadowColor(color);
// });
}

for (String decorationKey : TextDecoration.NAMES.keys()) {
Expand Down Expand Up @@ -412,8 +412,9 @@ public AdventureNBTSerializer(boolean downsampleColor) {
if (color != null) writer.writeUTF("color", this.serializeColor(color));

if (BackwardCompatUtil.IS_4_18_0_OR_NEWER) {
ShadowColor shadowColor = style.shadowColor();
if (shadowColor != null) writer.writeUTF("shadow_color", shadowColor.asHexString());
// FIXME adventure v4.18.0
// ShadowColor shadowColor = style.shadowColor();
// if (shadowColor != null) writer.writeUTF("shadow_color", shadowColor.asHexString());
}

for (TextDecoration decoration : TextDecoration.NAMES.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ version = rootProject.version
description = rootProject.description

repositories {
// FIXME remove when adventure releases 4.18.0
maven("https://repo.booky.dev/releases/") {
content {
includeGroup("net.kyori")
}
}
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ version = rootProject.version
description = rootProject.description

repositories {
// FIXME remove when adventure releases 4.18.0
maven("https://repo.booky.dev/releases/") {
content {
includeGroup("net.kyori")
}
}
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
}
Expand Down
2 changes: 1 addition & 1 deletion libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
adventure = "4.18.0-SNAPSHOT" # FIXME bump to release when released
adventure = "4.17.0" # FIXME adventure v4.18.0
examination = "1.3.0"
netty = "4.1.72.Final"
jetbrains-annotations = "23.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ public final class BackwardCompatUtil {
boolean is4_18_0OrNewer = false;
try {
// shadow color support was added in 4.18.0
Style.empty().shadowColor();
is4_18_0OrNewer = true;
// FIXME adventure v4.18.0
// Style.empty().shadowColor();
// is4_18_0OrNewer = true;
} catch (Throwable ignored) {
}
IS_4_18_0_OR_NEWER = is4_18_0OrNewer;
Expand Down

0 comments on commit 0be838c

Please sign in to comment.