MCPcopy Create free account
hub / github.com/ZetaMap/MoreCommands / load

Method load

src/main/java/data/Switcher.java:159–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157 }
158
159 @SuppressWarnings("unchecked")
160 public static void load() {
161 if (Core.settings.has("SwitchList"))
162 Core.settings.getJson("SwitchList", ObjectMap.class, ObjectMap::new).each((k, v) -> {
163 String value = (String) v;
164 put((String) k, value.subSequence(0, value.lastIndexOf('-')).toString(), Boolean.valueOf(value.substring(value.lastIndexOf('-')+1)));
165 });
166
167 else saveSettings();
168 }
169
170 public static void saveSettings() {
171 if (lobby == null) Core.settings.putJson("SwitchList", ordonedList.asMap(i -> i.name, i -> i.address() + "-" + i.forAdmin));

Callers 1

moreCommandsPluginMethod · 0.95

Calls 3

putMethod · 0.95
saveSettingsMethod · 0.95
eachMethod · 0.45

Tested by

no test coverage detected