diff --git a/src/haven/Resource.java b/src/haven/Resource.java index d77a045..96071d7 100644 --- a/src/haven/Resource.java +++ b/src/haven/Resource.java @@ -136,7 +136,7 @@ public ImageReadException() { } } - public static BufferedImage readimage(InputStream fp) throws IOException { + public static BufferedImage readimage(final InputStream fp) throws IOException { try { /* This can crash if not privileged due to ImageIO * creating tempfiles without doing that privileged @@ -1480,6 +1480,11 @@ private void loadfromdecode(String full) throws Exception { Constructor cons; df = l[i].listFiles(); + Arrays.sort(df, new Comparator() { + public int compare(File a, File b) { + return a.getName().compareTo(b.getName()); + } + }); switch (n) { case "image": case "tile": { /* .data + .png */