mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
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.
This commit is contained in:
parent
2df1dace32
commit
8748ae16ac
@ -196,7 +196,7 @@ index 0000000000000000000000000000000000000000..a27d3d41109271834b6c37fa22d4b80d
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..86775cd8ba9956ecaa4522acf15ed7b83dabcdbd
|
||||
index 0000000000000000000000000000000000000000..1f9835a20fb12021c0c791ebde2b0ee84d0306b4
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersionRegistry.java
|
||||
@@ -0,0 +1,425 @@
|
||||
@ -439,7 +439,7 @@ index 0000000000000000000000000000000000000000..86775cd8ba9956ecaa4522acf15ed7b8
|
||||
+ 3825,
|
||||
+ 3828,
|
||||
+ 3833
|
||||
+ // All up to 1.20.6-rc1
|
||||
+ // All up to 1.20.6
|
||||
+ };
|
||||
+ Arrays.sort(converterVersions);
|
||||
+
|
||||
@ -627,10 +627,10 @@ index 0000000000000000000000000000000000000000..86775cd8ba9956ecaa4522acf15ed7b8
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3379bb124b17bc0b96a5054404b6a3f545af7aee
|
||||
index 0000000000000000000000000000000000000000..93acc54f3acdc7d4f2ef10bf712f2588f7e1416d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/MCVersions.java
|
||||
@@ -0,0 +1,526 @@
|
||||
@@ -0,0 +1,527 @@
|
||||
+package ca.spottedleaf.dataconverter.minecraft;
|
||||
+
|
||||
+@SuppressWarnings("unused")
|
||||
@ -1154,6 +1154,7 @@ index 0000000000000000000000000000000000000000..3379bb124b17bc0b96a5054404b6a3f5
|
||||
+ 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() {}
|
||||
+}
|
||||
@ -2505,7 +2506,7 @@ index 0000000000000000000000000000000000000000..084c67a46bc5ec7f5a4bef3216805a87
|
||||
+}
|
||||
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/custom/V3818_Commands.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/custom/V3818_Commands.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..17e75ef0fe1f7e20d4100b40c445c9fccbf23833
|
||||
index 0000000000000000000000000000000000000000..7cd980b32ce45af9de1849d61b8f1817b0a4afa0
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/converters/custom/V3818_Commands.java
|
||||
@@ -0,0 +1,288 @@
|
||||
@ -2586,8 +2587,8 @@ index 0000000000000000000000000000000000000000..17e75ef0fe1f7e20d4100b40c445c9fc
|
||||
+ 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);
|
||||
|
Loading…
Reference in New Issue
Block a user