From 13ecfcea8a7b4022433d99b5ecd035b690e00c02 Mon Sep 17 00:00:00 2001 From: sekwah Date: Tue, 23 Jan 2018 06:01:30 +0000 Subject: [PATCH] Test json writer --- src/com/sekwah/advancedportals/core/util/Config.java | 2 +- src/com/sekwah/advancedportals/core/util/DataStorage.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/sekwah/advancedportals/core/util/Config.java b/src/com/sekwah/advancedportals/core/util/Config.java index 192ab2b..30bd706 100644 --- a/src/com/sekwah/advancedportals/core/util/Config.java +++ b/src/com/sekwah/advancedportals/core/util/Config.java @@ -5,7 +5,7 @@ package com.sekwah.advancedportals.core.util; */ public class Config { - private boolean useOnlySpecialAxe = false; + private boolean useOnlySpecialAxe; private String axeMaterial = "IRON_AXE"; diff --git a/src/com/sekwah/advancedportals/core/util/DataStorage.java b/src/com/sekwah/advancedportals/core/util/DataStorage.java index bc2ce99..abdb153 100644 --- a/src/com/sekwah/advancedportals/core/util/DataStorage.java +++ b/src/com/sekwah/advancedportals/core/util/DataStorage.java @@ -50,8 +50,12 @@ public class DataStorage { } public void storeJson(Object dataHolder, String location) { + String json = gson.toJson(dataHolder); try { - gson.toJson(dataHolder, new FileWriter(new File(this.dataFolder, location))); + FileWriter fileWriter = new FileWriter(new File(this.dataFolder, location)); + System.out.println(json); + fileWriter.write(json); + fileWriter.close(); } catch (IOException e) { e.printStackTrace(); }