mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-02 08:59:50 +01:00
Test json writer
This commit is contained in:
parent
5c33600008
commit
13ecfcea8a
@ -5,7 +5,7 @@ package com.sekwah.advancedportals.core.util;
|
|||||||
*/
|
*/
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
private boolean useOnlySpecialAxe = false;
|
private boolean useOnlySpecialAxe;
|
||||||
|
|
||||||
private String axeMaterial = "IRON_AXE";
|
private String axeMaterial = "IRON_AXE";
|
||||||
|
|
||||||
|
@ -50,8 +50,12 @@ public class DataStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void storeJson(Object dataHolder, String location) {
|
public void storeJson(Object dataHolder, String location) {
|
||||||
|
String json = gson.toJson(dataHolder);
|
||||||
try {
|
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) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user