From 009028624e7fd3ffe790421f7cd968e41a7dc676 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 29 Jan 2022 17:59:01 +0100 Subject: [PATCH] Don't close file systems (otherwise game will crash) --- src/main/java/ru/bclib/util/ModUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/bclib/util/ModUtil.java b/src/main/java/ru/bclib/util/ModUtil.java index 8d09dd91..7be383e4 100644 --- a/src/main/java/ru/bclib/util/ModUtil.java +++ b/src/main/java/ru/bclib/util/ModUtil.java @@ -374,10 +374,12 @@ public class ModUtil { URI uri = URI.create("jar:" + file.toUri()); FileSystem fs; + boolean doClose = false; try { fs = FileSystems.getFileSystem(uri); } catch (Exception e) { + doClose = true; fs = FileSystems.newFileSystem(file); } if (fs != null) { @@ -396,7 +398,7 @@ public class ModUtil { catch (Exception e) { BCLib.LOGGER.error("Error for " + uri + ": " + e.toString()); } - fs.close(); + //if (doClose) fs.close(); } } catch (Exception e) {