public static void SaveFile(String fileName, byte[][] map) {
        try {

            file = new File("" + fileName + ".jps");

            writer = new BufferedWriter(new FileWriter(file));
            writer.write("javapowder-save\n");
           // writer.write("version:" + var.versionID + "\n");
            writer.write("map:\n");
            for (int x = 0; x < map.length; x++) {
                for (int y = 0; y < map[0].length; y++) {
                    writer.write((int) map[x][y]);
                }
            }
            /*
            writer.write("vmap:\n");
            for (int y = 0; y < var.Height; y++) {
                for (int x = 0; x < var.Width; x++) {
                    writer.write((int) var.VMap[x][y]);
                }
            }
            writer.write("pmap:\n");
            for (int y = 0; y < var.Height; y++) {
                for (int x = 0; x < var.Width; x++) {
                    writer.write((int) var.PMap[x][y]);
                    }
            }*/


        } catch (IOException exception) {
            System.out.println("I/O Exception!" + exception.getMessage());
        } finally {
            try {
                if(writer != null)
                {
                    writer.close();
                }
            } catch (IOException e) {

                e.printStackTrace();
            }
            System.out.println("Write operation ended.");
        }
        }