mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix DiskOptimisedClipboard not closing
This commit is contained in:
parent
76efbed4b2
commit
3cd30ebbff
@ -10,7 +10,6 @@ import com.sk89q.jnbt.IntTag;
|
|||||||
import com.sk89q.jnbt.Tag;
|
import com.sk89q.jnbt.Tag;
|
||||||
import com.sk89q.worldedit.entity.BaseEntity;
|
import com.sk89q.worldedit.entity.BaseEntity;
|
||||||
import com.sk89q.worldedit.entity.Entity;
|
import com.sk89q.worldedit.entity.Entity;
|
||||||
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
|
|
||||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
@ -99,7 +98,6 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
log.warn("Creating new RandomAccessFile: " + file.getPath());
|
|
||||||
this.braf = new RandomAccessFile(file, "rw");
|
this.braf = new RandomAccessFile(file, "rw");
|
||||||
long fileLength = (long) getVolume() * 2L + (long) HEADER_SIZE;
|
long fileLength = (long) getVolume() * 2L + (long) HEADER_SIZE;
|
||||||
braf.setLength(0);
|
braf.setLength(0);
|
||||||
@ -286,7 +284,6 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
|
|||||||
if (byteBuffer != null) {
|
if (byteBuffer != null) {
|
||||||
byteBuffer.force();
|
byteBuffer.force();
|
||||||
fileChannel.close();
|
fileChannel.close();
|
||||||
log.warn("Closing the RandomAccessFile: " + file.getPath());
|
|
||||||
braf.close();
|
braf.close();
|
||||||
//noinspection ResultOfMethodCallIgnored
|
//noinspection ResultOfMethodCallIgnored
|
||||||
file.setWritable(true);
|
file.setWritable(true);
|
||||||
|
@ -271,6 +271,11 @@ public class BlockArrayClipboard implements Clipboard {
|
|||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void close() {
|
||||||
|
this.parent.close();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores entity data.
|
* Stores entity data.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user