private static void initGuiConfig(JSONObject json, Gui gui) throws BadConfig {
		JSONObject guiConfig = toJSONObject("gui-config", json.get("gui-config"), false);
		try {
			if (guiConfig == null) {
				gui.setConfigLocation(null, null);
				return;
			}
			gui.setConfigSize(toInteger("width", guiConfig.get("width"), false), toInteger("height", guiConfig.get("height"), false));
			gui.setConfigLocation(toString("location-x", guiConfig.get("location-x"), false), toString("location-y",
					guiConfig.get("location-y"), false));
		} catch (InvalidParameterException e) {
			throw new BadConfig(e.getMessage());
		}
	}