[DataConverter] Fix generator options parsing

This commit is contained in:
Joseph Burton 2022-06-05 22:49:42 +01:00 committed by Shane Freeder
parent b3deb2589e
commit d8ef841114
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -10527,7 +10527,7 @@ index 0000000000000000000000000000000000000000..7db79b279a047ec5907a3fb2c6e1a75b
+} +}
diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..d67a44b7154825efd3e3fd50e0e708ef839866f7 index 0000000000000000000000000000000000000000..ef679762aec326e5e1310390bca46971b548e7cd
--- /dev/null --- /dev/null
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V1506.java
@@ -0,0 +1,219 @@ @@ -0,0 +1,219 @@
@ -10652,7 +10652,7 @@ index 0000000000000000000000000000000000000000..d67a44b7154825efd3e3fd50e0e708ef
+ if ("flat".equalsIgnoreCase(generatorName)) { + if ("flat".equalsIgnoreCase(generatorName)) {
+ data.setMap("generatorOptions", V1506.convert(generatorOptions == null ? "" : generatorOptions)); + data.setMap("generatorOptions", V1506.convert(generatorOptions == null ? "" : generatorOptions));
+ } else if ("buffet".equalsIgnoreCase(generatorName) && generatorOptions != null) { + } else if ("buffet".equalsIgnoreCase(generatorName) && generatorOptions != null) {
+ data.setMap("generatorOptions", JsonTypeUtil.convertJsonToNBT(new JsonMapType(GsonHelper.parse(generatorName, true), false))); + data.setMap("generatorOptions", JsonTypeUtil.convertJsonToNBT(new JsonMapType(GsonHelper.parse(generatorOptions, true), false)));
+ } + }
+ return null; + return null;
+ } + }