mcaselector
mcaselector copied to clipboard
Chunk deletion fails silently on region files without proper sector padding
Describe the bug Chunk deletion fails silently on region files that don't have proper 4096-byte sector padding on the last chunk. The operation appears to complete successfully but the files are unchanged. This affects files exported by tools like WorldTools.
To Reproduce
- Download a world using WorldTools (creates region files without full sector padding)
- Open the downloaded world in MCA Selector
- Select some chunks
- Use
Selection > Delete selected chunks - Operation appears to complete successfully
- Check the world - chunks are NOT deleted
Expected behavior Selected chunks should be deleted from the region files.
Screenshots and other files From debug.log:
11:56:34.680 [savePool-thread-1] WARN SelectionDeleter: failed to delete selected chunks from r.-559.-600.mca
java.io.EOFException: null
at java.base/java.io.RandomAccessFile.readFully(Unknown Source) ~[?:?]
at java.base/java.io.RandomAccessFile.readFully(Unknown Source) ~[?:?]
at net.querz.mcaselector.io.mca.MCAFile.deFragment(MCAFile.java:204) ~[mcaselector.jar:?]
...
Environment (please complete the following information):
- OS: Windows 11 (used Windows installer)
- Version of MCA Selector: 2.6.1 (also affects 2.6.0)
Additional context
- Works correctly in version 2.5.3
- Introduced in commit b0944681 which changed
DataInputStream.read(data)toRandomAccessFile.readFully(data)in thedeFragment()method read()handles partial reads gracefully (returns bytes read)readFully()throwsEOFExceptionif file ends early- WorldTools exports region files where the last chunk isn't padded to full sector boundaries, triggering the
EOFException - The exception is caught and logged, but progress continues - so the user sees success while the file is unchanged