()
| 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)); |
no test coverage detected