MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / get

Method get

src/main/java/com/volmit/adapt/AdaptConfig.java:82–108  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 private boolean verbose = false;
81
82 public static AdaptConfig get() {
83 if (config == null) {
84 AdaptConfig dummy = new AdaptConfig();
85 File l = Adapt.instance.getDataFile("adapt", "adapt.json");
86
87
88 if (!l.exists()) {
89 try {
90 IO.writeAll(l, new JSONObject(new Gson().toJson(dummy)).toString(4));
91 } catch (IOException e) {
92 e.printStackTrace();
93 config = dummy;
94 return dummy;
95 }
96 }
97
98 try {
99 config = new Gson().fromJson(IO.readAll(l), AdaptConfig.class);
100 IO.writeAll(l, new JSONObject(new Gson().toJson(config)).toString(4));
101 } catch (IOException e) {
102 e.printStackTrace();
103 config = new AdaptConfig();
104 }
105 }
106
107 return config;
108 }
109
110 @Getter
111 public static class Protector {

Callers 15

startMethod · 0.95
startupPrintMethod · 0.95
setupMetricsMethod · 0.95
printInformationMethod · 0.95
debugMethod · 0.95
verboseMethod · 0.95
executeMethod · 0.95
getXpForLevelMethod · 0.95
getLevelForXpMethod · 0.95
shouldReturnForWorldMethod · 0.95
isWorldBlacklistedMethod · 0.95

Calls 6

writeAllMethod · 0.95
readAllMethod · 0.95
getDataFileMethod · 0.80
fromJsonMethod · 0.80
toStringMethod · 0.45
toJsonMethod · 0.45

Tested by

no test coverage detected