Fixup chat messages on 1.21 as well

This commit is contained in:
FlorianMichael 2024-06-18 00:05:27 +02:00
parent b0a68be851
commit 9871d1f745
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -18,6 +18,7 @@
package com.viaversion.fabric.mc121.commands;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.util.ComponentUtil;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.command.CommandSource;
import net.minecraft.entity.Entity;
@ -43,7 +44,7 @@ public class NMSCommandSender implements ViaCommandSender {
}
public static MutableText fromLegacy(String legacy) {
return Text.Serialization.fromJson(legacy, DynamicRegistryManager.EMPTY);
return Text.Serialization.fromJson(ComponentUtil.legacyToJsonString(legacy), DynamicRegistryManager.EMPTY);
}
@Override