mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Fixed McRegionReader not being closed.
This commit is contained in:
parent
1d68fdd11c
commit
49b4c190f9
@ -48,8 +48,15 @@ public static String getFilename(Vector2D pos) {
|
||||
|
||||
protected McRegionReader getReader(Vector2D pos) throws DataException, IOException {
|
||||
String filename = getFilename(pos);
|
||||
if (curFilename != null && curFilename.equals(filename)) {
|
||||
return cachedReader;
|
||||
if (curFilename != null) {
|
||||
if (curFilename.equals(filename)) {
|
||||
return cachedReader;
|
||||
} else {
|
||||
try {
|
||||
cachedReader.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
InputStream stream = getInputStream(filename);
|
||||
cachedReader = new McRegionReader(stream);
|
||||
|
Loading…
Reference in New Issue
Block a user