From af67859c568e1b94294d78d4b98115c0b26cb879 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 10 May 2024 00:34:37 -0700
Subject: [PATCH] Use MCDataConverter instead of raw convert call for cmd
 converter

MCDataConverter uses the breakpoint system, which for future
updates may be neccesary (probably not).

Also, add the 1.20.6 version field.
---
 patches/server/Rewrite-dataconverter-system.patch | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/patches/server/Rewrite-dataconverter-system.patch b/patches/server/Rewrite-dataconverter-system.patch
index 290f320298..7e6e24121a 100644
--- a/patches/server/Rewrite-dataconverter-system.patch
+++ b/patches/server/Rewrite-dataconverter-system.patch
@@ -439,7 +439,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                3825,
 +                3828,
 +                3833
-+                // All up to 1.20.6-rc1
++                // All up to 1.20.6
 +        };
 +        Arrays.sort(converterVersions);
 +
@@ -1154,6 +1154,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    public static final int V1_20_5_RC3           = 3836;
 +    public static final int V1_20_5               = 3837;
 +    public static final int V1_20_6_RC1           = 3838;
++    public static final int V1_20_6               = 3839;
 +
 +    private MCVersions() {}
 +}
@@ -2586,8 +2587,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                final String cmdString = cmd.getAsString();
 +
 +                if ((actionString.equals("suggest_command") && cmdString.startsWith("/")) || actionString.equals("run_command")) {
-+                    final Object res = MCTypeRegistry.DATACONVERTER_CUSTOM_TYPE_COMMAND.convert(
-+                            cmdString, MCVersions.V1_20_4, SharedConstants.getCurrentVersion().getDataVersion().getVersion()
++                    final Object res = MCDataConverter.convert(
++                        MCTypeRegistry.DATACONVERTER_CUSTOM_TYPE_COMMAND, cmdString, MCVersions.V1_20_4, SharedConstants.getCurrentVersion().getDataVersion().getVersion()
 +                    );
 +                    if (res instanceof String newCmd) {
 +                        clickEvent.addProperty("value", newCmd);