[MC-12074] Textures can't be overwritten while in-game Created: 16/Mar/13  Updated: 27/Apr/14  Resolved: 11/Aug/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 13w37b, Minecraft 13w41b
Fix Version/s: None

Type: Bug
Reporter: Robin Fernqvist Assignee: Unassigned
Resolution: Invalid Votes: 3
Labels: None

Issue Links:
Duplicate
is duplicated by MC-53835 Resource Packs are still loaded into ... Resolved
CHK:
Confirmation Status: Community Consensus

 Description   

Hello!
I'm making a texture pack, and when i modify my texture(s) using Photoshop,
i can't save over the file i'm working on (from time to time).

Sometimes i can save the image and then tab to minecraft, hold F3 and press T and the texture is updated, but most of the times i get an error prompt saying the "file is already in use". But if i wait for like 2-5 minutes i can save it again (without closing minecraft)..
This makes it very tedious for us texture makers, it worked flawlessly with the old terrain.png, though i had this same problem before when editing parts of the GUI etc.

The only way to solve this right now is to close minecraft, save image, re-open minecraft and log back in, or wait 2-5 minutes.



 Comments   
Comment by Tails [ 11/Aug/13 ]

Texture packs are obsolete, if you have issues with resource packs, please let us know .

Comment by Tails [ 21/May/13 ]

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Ben W [ 14/Apr/13 ]

Happened to me in 1.5.1. Just started playing around with making a texture pack, and ran into this same issue. It's not a major project of mine, so this is only a minor bug for me, but yeah.

Notably, I found that this is still an issue even when the texture pack I'm trying to modify is not the active one. This is obviously a bug, as Minecraft shouldn't be reading from any pack other than the active one, right...?

As mrheat and C.J. Wijtmans said, the cause is obvious: Minecraft is forgetting to release a lock on the texture pack zip file, and as a result retains exclusive access to the file when it's not strictly needed.
It's a very common file I/O pitfall, and the fix is trivial - just putting a texturePackZipFileObject.close() after loading the pack should suffice.

Comment by C.J. Wijtmans [ 17/Mar/13 ]

i Guess it would be an easy fix then. file.close()

Comment by user-571ee (Inactive) [ 17/Mar/13 ]

I guess the files aren't properly closed in the Java code. Obviously they are closed by the Java garbage collector. This is why it works after a few minutes. So yes, this is a bug.

Comment by Robin Fernqvist [ 16/Mar/13 ]

Well yes, that's how they work currently, and if they're not intended to work this way, it's a bug.
If you don't know for sure that this is how it's meant to be, your comment just doesn't make any sense.

Generated at Sun Jan 12 12:29:43 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.