From 254b9d40537f1a3f9638c0738f608211e0c3a1a4 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 12 Oct 2014 23:08:48 +1100 Subject: [PATCH] close stream --- .../src/com/intellectualcrafters/plot/SchematicHandler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/SchematicHandler.java b/PlotSquared/src/com/intellectualcrafters/plot/SchematicHandler.java index c502d1290..e2d8f9cc1 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/SchematicHandler.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/SchematicHandler.java @@ -68,13 +68,13 @@ public class SchematicHandler { InputStream iStream = new FileInputStream(file); NBTInputStream stream = new NBTInputStream(new GZIPInputStream(iStream)); CompoundTag tag = (CompoundTag) stream.readTag(); + stream.close(); Map tagMap = tag.getValue(); byte[] addId = new byte[0]; if (tagMap.containsKey("AddBlocks")) { addId = ByteArrayTag.class.cast(tagMap.get("AddBlocks")).getValue(); } - short width = ShortTag.class.cast(tagMap.get("Width")).getValue(); short length = ShortTag.class.cast(tagMap.get("Length")).getValue(); short height = ShortTag.class.cast(tagMap.get("Height")).getValue(); @@ -112,9 +112,7 @@ public class SchematicHandler { e.printStackTrace(); return null; } - finally { - return schematic; - } + return schematic; } public static class Schematic {