diff --git a/paper-api/build.gradle.kts b/paper-api/build.gradle.kts index 9a03c630be98..3ea140477c45 100644 --- a/paper-api/build.gradle.kts +++ b/paper-api/build.gradle.kts @@ -11,7 +11,7 @@ java { val annotationsVersion = "24.1.0" val bungeeCordChatVersion = "1.20-R0.2" -val adventureVersion = "4.17.0" +val adventureVersion = "4.18.0" val slf4jVersion = "2.0.9" val log4jVersion = "2.17.1" diff --git a/paper-server/build.gradle.kts b/paper-server/build.gradle.kts index baa638e0dd99..09554e3ac872 100644 --- a/paper-server/build.gradle.kts +++ b/paper-server/build.gradle.kts @@ -128,7 +128,7 @@ dependencies { implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 implementation("net.minecrell:terminalconsoleappender:1.3.0") - implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file + implementation("net.kyori:adventure-text-serializer-ansi:4.18.0") // Keep in sync with adventureVersion from Paper-API build file /* Required to add the missing Log4j2Plugins.dat file from log4j-core diff --git a/paper-server/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java b/paper-server/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java index 2c5702a42c4a..7a47f0fda0f8 100644 --- a/paper-server/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java +++ b/paper-server/src/main/java/io/papermc/paper/adventure/AdventureCodecs.java @@ -11,7 +11,6 @@ import com.mojang.serialization.JsonOps; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Map; @@ -37,6 +36,7 @@ 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; @@ -79,6 +79,8 @@ public final class AdventureCodecs { public static final Codec COMPONENT_CODEC = recursive("adventure Component", AdventureCodecs::createCodec); public static final StreamCodec STREAM_COMPONENT_CODEC = ByteBufCodecs.fromCodecWithRegistriesTrusted(COMPONENT_CODEC); + static final Codec SHADOW_COLOR_CODEC = ExtraCodecs.ARGB_COLOR_CODEC.xmap(ShadowColor::shadowColor, ShadowColor::value); + static final Codec TEXT_COLOR_CODEC = Codec.STRING.comapFlatMap(s -> { if (s.startsWith("#")) { @Nullable TextColor value = TextColor.fromHexString(s); @@ -220,6 +222,7 @@ public String getSerializedName() { public static final MapCodec