NightJson: remove empty line before comment

This commit is contained in:
Martin Prokoph
2025-08-02 23:05:43 +02:00
parent f3c211f0a6
commit fcf7f2a4f1
2 changed files with 5 additions and 9 deletions

View File

@@ -54,6 +54,7 @@ public class NightJson {
jsonFile.close(); jsonFile.close();
} catch (IOException | IllegalAccessException e) { } catch (IOException | IllegalAccessException e) {
System.out.println("Oh no! An Error occurred whilst writing the JSON file :("); System.out.println("Oh no! An Error occurred whilst writing the JSON file :(");
//noinspection CallToPrintStackTrace
e.printStackTrace(); e.printStackTrace();
} }
} }
@@ -61,7 +62,7 @@ public class NightJson {
private void writeElement(FileWriter jsonFile, Object value, Class<?> type, String name, boolean hasNext) throws IOException, IllegalAccessException { private void writeElement(FileWriter jsonFile, Object value, Class<?> type, String name, boolean hasNext) throws IOException, IllegalAccessException {
jsonFile.write("\t"); jsonFile.write("\t");
if (type == Comment.class) { if (type == Comment.class) {
jsonFile.write(String.format("\n\t// %s\n", ((Comment) value).commentString)); jsonFile.write(String.format("// %s\n", ((Comment) value).commentString));
return; return;
} }
jsonFile.write(String.format("\"%s\": ", name)); jsonFile.write(String.format("\"%s\": ", name));
@@ -112,6 +113,7 @@ public class NightJson {
} }
} catch (IOException | IllegalAccessException | NoSuchElementException | ClassCastException e) { } catch (IOException | IllegalAccessException | NoSuchElementException | ClassCastException e) {
System.out.println("Oh no! An Error occurred whilst reading the JSON file :("); System.out.println("Oh no! An Error occurred whilst reading the JSON file :(");
//noinspection CallToPrintStackTrace
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@@ -1,20 +1,14 @@
{ {
// Volume of theme music (0-100) // Volume of theme music (0-100)
"musicVolume": 100, "musicVolume": 30,
// Volume of sound effects (0-100) // Volume of sound effects (0-100)
"soundVolume": 100, "soundVolume": 100,
// Amount the user interface should be scaled // Amount the user interface should be scaled
"guiScale": 4.49, "guiScale": 5.7,
// Whether speed should scale with level (true/false) // Whether speed should scale with level (true/false)
"shouldScaleSpeed": true, "shouldScaleSpeed": true,
// One of [Noob, Easy, Normal, Hard, Extreme, WTF] // One of [Noob, Easy, Normal, Hard, Extreme, WTF]
"difficulty": "Normal", "difficulty": "Normal",
// One of [English, Deutsch] // One of [English, Deutsch]
"language": "Deutsch" "language": "Deutsch"
} }