From 76374f49dde18ee744cdcb286d75a23cd35ddfd8 Mon Sep 17 00:00:00 2001 From: Vankka Date: Sun, 16 Jun 2024 14:41:53 +0300 Subject: [PATCH] Fix deprecation in ComponentFactory --- .../com/discordsrv/common/component/ComponentFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/discordsrv/common/component/ComponentFactory.java b/common/src/main/java/com/discordsrv/common/component/ComponentFactory.java index 7ad3735d..845180b8 100644 --- a/common/src/main/java/com/discordsrv/common/component/ComponentFactory.java +++ b/common/src/main/java/com/discordsrv/common/component/ComponentFactory.java @@ -32,6 +32,7 @@ import dev.vankka.mcdiscordreserializer.minecraft.MinecraftSerializer; import dev.vankka.mcdiscordreserializer.minecraft.MinecraftSerializerOptions; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TranslatableComponent; +import net.kyori.adventure.text.TranslationArgument; import net.kyori.adventure.text.flattener.ComponentFlattener; import net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; @@ -90,10 +91,9 @@ public class ComponentFactory implements MinecraftComponentFactory { } return translation.translate( - component.args() + component.arguments() .stream() - .map(discordSerializer::serialize) - .map(str -> (Object) str) + .map(TranslationArgument::value) .toArray(Object[]::new) ); }