public static MultiBlockStructure getMap(String mapName, App app) { File file = new File(mapName + ".txt"); if (!file.exists() || !file.canRead()) { return null; } MultiBlockStructure list = null; try { Scanner reader = new Scanner(file); while (reader.hasNextLine()) { String data = reader.nextLine(); list = MultiBlockStructure.create(data, mapName); } reader.close(); return list; } catch (FileNotFoundException e) { System.out.println("An error occurred."); e.printStackTrace(); return null; } }