Add explicit create file to save

This commit is contained in:
satellite 2021-04-04 23:45:32 -04:00
parent 3baf78f599
commit 8ac86a0c84
2 changed files with 2 additions and 1 deletions

View File

@ -59,6 +59,7 @@ public class TerrainManager {
Gson gson = new Gson(); Gson gson = new Gson();
String terrainOutRaw = gson.toJson(model); String terrainOutRaw = gson.toJson(model);
try { try {
Files.createFile(new File(Globals.mainConfig.loadTerrainLocation).toPath());
Files.write(new File(Globals.mainConfig.loadTerrainLocation).toPath(), terrainOutRaw.getBytes()); Files.write(new File(Globals.mainConfig.loadTerrainLocation).toPath(), terrainOutRaw.getBytes());
} catch (IOException ex) { } catch (IOException ex) {
ex.printStackTrace(); ex.printStackTrace();

View File

@ -1,5 +1,5 @@
{ {
"projectMainDirectory" : "/Users/satellite/p/Renderer/src/main/resources/Config", "projectMainDirectory" : "/Users/satellite/p/Renderer/src/main/resources/Config",
"loadTerrain" : true, "loadTerrain" : false,
"loadTerrainLocation" : "/Users/satellite/p/Renderer/src/main/resources/Config/terrain.json" "loadTerrainLocation" : "/Users/satellite/p/Renderer/src/main/resources/Config/terrain.json"
} }