Fix DataConverter ConverterParticleToNBT.parseProperties

- The old code was using `StringReader.peek()` in a place where it meant to be `StringReader.skip()`.
- The vanilla code allows a trailing comma, but only if there is no whitespace between it and the closing bracket, which is a bit weird. I think that's a bug and it shouldn't allow trailing commas, but if you disagree then only the first issue needs to be fixed.
This commit is contained in:
Joseph Burton
2024-05-10 00:31:58 -07:00
parent 79fcb6baf4
commit 67b30c5ed5

View File

@@ -7970,9 +7970,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ reader.expect('[');
+ reader.skipWhitespace();
+
+ while (reader.canRead() && reader.peek() != ']') {
+ reader.skipWhitespace();
+
+ if (reader.canRead() && reader.peek() != ']') {
+ while (reader.canRead()) {
+ final String property = reader.readString();
+
+ reader.skipWhitespace();
@@ -7990,7 +7989,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ // skip ',' and move onto next entry
+ reader.peek();
+ reader.skip();
+ }
+
+ reader.skipWhitespace();
+ }
+ }
+