diff --git a/gradle.properties b/gradle.properties index 82b60955..2f761e94 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ flkVersion = 1.10.19+kotlin.1.9.23 # required dependency mods required.adventure-platform-fabric.artifact = net.kyori:adventure-platform-fabric -required.adventure-platform-fabric.version = 5.11.0 +required.adventure-platform-fabric.version = 5.12.0 required.adventure-platform-fabric.versionSpec = ~ required.libgui.artifact = io.github.cottonmc:LibGui diff --git a/src/main/java/io/github/homchom/recode/feature/visual/BuiltInResourcePacks.kt b/src/main/java/io/github/homchom/recode/feature/visual/BuiltInResourcePacks.kt index 658a3c7c..b1967511 100644 --- a/src/main/java/io/github/homchom/recode/feature/visual/BuiltInResourcePacks.kt +++ b/src/main/java/io/github/homchom/recode/feature/visual/BuiltInResourcePacks.kt @@ -6,8 +6,9 @@ import io.github.homchom.recode.feature.AddsFeature import io.github.homchom.recode.feature.registerFeature import io.github.homchom.recode.id import io.github.homchom.recode.render.RGB -import io.github.homchom.recode.ui.text.VanillaComponent -import io.github.homchom.recode.ui.text.VanillaStyle +import io.github.homchom.recode.ui.text.style +import io.github.homchom.recode.ui.text.text +import io.github.homchom.recode.ui.text.toVanillaComponent import net.fabricmc.fabric.api.resource.ResourceManagerHelper import net.fabricmc.fabric.api.resource.ResourcePackActivationType @@ -24,16 +25,16 @@ object FBuiltInResourcePacks { displayColor: RGB, activationType: ResourcePackActivationType = ResourcePackActivationType.DEFAULT_ENABLED ) { - // https://github.com/KyoriPowered/adventure-platform-fabric/issues/122 - val packDescription = VanillaComponent.literal("[$MOD_ID] ") - .append(VanillaComponent.translatable("resourcePack.recode.$id") - .withStyle(VanillaStyle.EMPTY.withColor(displayColor.hex)) - ) + + val packDescription = text { + literal("[$MOD_ID] ") + translate("resourcePack.recode.$id", style().color(displayColor)) + } ResourceManagerHelper.registerBuiltinResourcePack( id(id), Recode, - packDescription, + packDescription.toVanillaComponent(), activationType ) } diff --git a/src/main/java/io/github/homchom/recode/feature/visual/ExpressionHighlighting.kt b/src/main/java/io/github/homchom/recode/feature/visual/ExpressionHighlighting.kt index 04c7f9a3..1f752138 100644 --- a/src/main/java/io/github/homchom/recode/feature/visual/ExpressionHighlighting.kt +++ b/src/main/java/io/github/homchom/recode/feature/visual/ExpressionHighlighting.kt @@ -114,12 +114,7 @@ class ExpressionHighlighter { val text = builder.build().toFormattedCharSequence(false) val preview = if (parseMiniMessage) { - try { - miniMessage.deserialize(string).toFormattedCharSequence() - } catch (e: Exception) { - // https://github.com/KyoriPowered/adventure/issues/1011 - null - } + miniMessage.deserialize(string).toFormattedCharSequence() } else null return HighlightedExpression(text, preview) } diff --git a/src/main/java/io/github/homchom/recode/render/StaticSkinRender.kt b/src/main/java/io/github/homchom/recode/render/StaticSkinRender.kt index 50106533..65014eb1 100644 --- a/src/main/java/io/github/homchom/recode/render/StaticSkinRender.kt +++ b/src/main/java/io/github/homchom/recode/render/StaticSkinRender.kt @@ -1,7 +1,6 @@ package io.github.homchom.recode.render import com.mojang.authlib.GameProfile -import net.kyori.adventure.identity.Identity import net.minecraft.Util import net.minecraft.client.Minecraft import net.minecraft.client.player.RemotePlayer @@ -17,7 +16,4 @@ class StaticSkinRender(client: Minecraft, private val skin: PlayerSkin) : Remote ) { override fun getSkin() = skin override fun isModelPartShown(part: PlayerModelPart) = true - - // https://github.com/KyoriPowered/adventure-platform-fabric/issues/120 - override fun identity() = gameProfile as Identity } \ No newline at end of file diff --git a/src/main/java/io/github/homchom/recode/ui/text/MiniMessageHighlighter.kt b/src/main/java/io/github/homchom/recode/ui/text/MiniMessageHighlighter.kt index 117473c3..6d37018f 100644 --- a/src/main/java/io/github/homchom/recode/ui/text/MiniMessageHighlighter.kt +++ b/src/main/java/io/github/homchom/recode/ui/text/MiniMessageHighlighter.kt @@ -111,12 +111,7 @@ class MiniMessageHighlighter(private val standardTags: TagResolver) { } } - val root = try { - instance.deserializeToTree(input) - } catch (e: Exception) { - // https://github.com/KyoriPowered/adventure/issues/1011 - return literalText(input, style().red()).asComponent() - } + val root = instance.deserializeToTree(input) buildNewInput(root) return instance.deserialize(newInput.toString()) } diff --git a/src/main/resources/resourcepacks/better_unicode/pack.mcmeta b/src/main/resources/resourcepacks/better_unicode/pack.mcmeta index 575ac7f1..08d7494b 100644 --- a/src/main/resources/resourcepacks/better_unicode/pack.mcmeta +++ b/src/main/resources/resourcepacks/better_unicode/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { - "pack_format": 18, + "pack_format": 22, "description": "vanilla-style unicode symbols.\n§8BetterUnicode by Electrosolt" } }