Only resize if expanding
This commit is contained in:
parent
371f61c36b
commit
fb3c8cc5e1
@ -238,10 +238,12 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
area = width * length;
|
area = width * length;
|
||||||
volume = width * length * height;
|
volume = width * length * height;
|
||||||
long size = width * height * length * 2l + HEADER_SIZE + (hasBiomes() ? area : 0);
|
long size = width * height * length * 2l + HEADER_SIZE + (hasBiomes() ? area : 0);
|
||||||
|
if (braf.length() < size) {
|
||||||
close();
|
close();
|
||||||
this.braf = new RandomAccessFile(file, "rw");
|
this.braf = new RandomAccessFile(file, "rw");
|
||||||
braf.setLength(size);
|
braf.setLength(size);
|
||||||
init();
|
init();
|
||||||
|
}
|
||||||
mbb.putChar(2, (char) width);
|
mbb.putChar(2, (char) width);
|
||||||
mbb.putChar(4, (char) height);
|
mbb.putChar(4, (char) height);
|
||||||
mbb.putChar(6, (char) length);
|
mbb.putChar(6, (char) length);
|
||||||
|
Loading…
Reference in New Issue
Block a user