mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 12:25:46 +01:00
close stream
This commit is contained in:
parent
8bdbd3e628
commit
254b9d4053
@ -68,13 +68,13 @@ public class SchematicHandler {
|
|||||||
InputStream iStream = new FileInputStream(file);
|
InputStream iStream = new FileInputStream(file);
|
||||||
NBTInputStream stream = new NBTInputStream(new GZIPInputStream(iStream));
|
NBTInputStream stream = new NBTInputStream(new GZIPInputStream(iStream));
|
||||||
CompoundTag tag = (CompoundTag) stream.readTag();
|
CompoundTag tag = (CompoundTag) stream.readTag();
|
||||||
|
stream.close();
|
||||||
Map<String, Tag> tagMap = tag.getValue();
|
Map<String, Tag> tagMap = tag.getValue();
|
||||||
|
|
||||||
byte[] addId = new byte[0];
|
byte[] addId = new byte[0];
|
||||||
if (tagMap.containsKey("AddBlocks")) {
|
if (tagMap.containsKey("AddBlocks")) {
|
||||||
addId = ByteArrayTag.class.cast(tagMap.get("AddBlocks")).getValue();
|
addId = ByteArrayTag.class.cast(tagMap.get("AddBlocks")).getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
short width = ShortTag.class.cast(tagMap.get("Width")).getValue();
|
short width = ShortTag.class.cast(tagMap.get("Width")).getValue();
|
||||||
short length = ShortTag.class.cast(tagMap.get("Length")).getValue();
|
short length = ShortTag.class.cast(tagMap.get("Length")).getValue();
|
||||||
short height = ShortTag.class.cast(tagMap.get("Height")).getValue();
|
short height = ShortTag.class.cast(tagMap.get("Height")).getValue();
|
||||||
@ -112,9 +112,7 @@ public class SchematicHandler {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
finally {
|
return schematic;
|
||||||
return schematic;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Schematic {
|
public static class Schematic {
|
||||||
|
Loading…
Reference in New Issue
Block a user