Fixup command execution on 1.20.6+

Closes https://github.com/ViaVersion/ViaFabric/issues/340
This commit is contained in:
FlorianMichael 2024-06-15 14:46:34 +02:00
parent 880a64c6c1
commit 113a6e354a
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -17,6 +17,7 @@
*/
package com.viaversion.fabric.mc1206.commands;
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