mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 14:27:59 +01:00
Fix file lock issues with the skin cache
This commit is contained in:
parent
d20199fffb
commit
72324feaf3
1 changed files with 6 additions and 4 deletions
|
@ -193,7 +193,8 @@ public class ThreadDownloadImageETag extends SimpleTexture {
|
|||
Files.createDirectories(cacheFile.getParent());
|
||||
Files.copy(resp.getInputStream(), cacheFile);
|
||||
|
||||
BufferedImage bufferedimage = ImageIO.read(Files.newInputStream(cacheFile));
|
||||
try (InputStream in = Files.newInputStream(cacheFile)) {
|
||||
BufferedImage bufferedimage = ImageIO.read(in);
|
||||
|
||||
// maybe write the etag to disk
|
||||
Header eTag = resp.getResponse().getFirstHeader(HttpHeaders.ETAG);
|
||||
|
@ -201,10 +202,11 @@ public class ThreadDownloadImageETag extends SimpleTexture {
|
|||
Files.write(eTagFile, Collections.singleton(eTag.getValue()));
|
||||
}
|
||||
|
||||
if (imageBuffer != null) {
|
||||
bufferedimage = imageBuffer.parseUserSkin(bufferedimage);
|
||||
if (imageBuffer != null) {
|
||||
bufferedimage = imageBuffer.parseUserSkin(bufferedimage);
|
||||
}
|
||||
setBufferedImage(bufferedimage);
|
||||
}
|
||||
setBufferedImage(bufferedimage);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
LOGGER.error("Couldn\'t download http texture", exception);
|
||||
|
|
Loading…
Reference in a new issue