diff --git a/project_resources/template/default_structure_pack/default_structure_pack.zip b/project_resources/template/default_structure_pack/default_structure_pack.zip index fbcff5117..f06f52b8e 100644 Binary files a/project_resources/template/default_structure_pack/default_structure_pack.zip and b/project_resources/template/default_structure_pack/default_structure_pack.zip differ diff --git a/src/main/java/net/shadowmage/ancientwarfare/structure/template/load/TemplateLoader.java b/src/main/java/net/shadowmage/ancientwarfare/structure/template/load/TemplateLoader.java index 0c200b867..6cd9c54c8 100644 --- a/src/main/java/net/shadowmage/ancientwarfare/structure/template/load/TemplateLoader.java +++ b/src/main/java/net/shadowmage/ancientwarfare/structure/template/load/TemplateLoader.java @@ -168,7 +168,7 @@ private void loadStructureImage(String imageName, InputStream is) try { MessageDigest md = MessageDigest.getInstance("MD5"); - DigestInputStream dis = new DigestInputStream(is, md); + DigestInputStream dis = new DigestInputStream(is, md);//InputStream is closed externally BufferedImage image = ImageIO.read(is); if(image!=null && image.getWidth()==AWStructureStatics.structureImageWidth && image.getHeight()==AWStructureStatics.structureImageHeight) { @@ -187,7 +187,7 @@ private void loadStructureImage(String imageName, InputStream is) { AWLog.logError("Attempted to load improper sized template image: "+imageName+ " with dimensions of: "+image.getWidth()+"x"+image.getHeight()+". Specified width/height is: "+AWStructureStatics.structureImageWidth+"x"+AWStructureStatics.structureImageHeight); } - dis.close(); +// dis.close(); } catch (IOException e) { @@ -352,7 +352,16 @@ else if(isProbableImage(currentFile)) { try { - loadStructureImage(currentFile.getName(), new FileInputStream(currentFile)); + FileInputStream fis = new FileInputStream(currentFile); + loadStructureImage(currentFile.getName(), fis); + try + { + fis.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } } catch (FileNotFoundException e) { diff --git a/src/main/resources/assets/ancientwarfare/template/default_structure_pack.zip b/src/main/resources/assets/ancientwarfare/template/default_structure_pack.zip index fbcff5117..f06f52b8e 100644 Binary files a/src/main/resources/assets/ancientwarfare/template/default_structure_pack.zip and b/src/main/resources/assets/ancientwarfare/template/default_structure_pack.zip differ