diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/ResourcePack.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/ResourcePack.java index 23729aa9..672acde5 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/ResourcePack.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resourcepack/ResourcePack.java @@ -135,6 +135,8 @@ public void load(Collection sources) throws IOException, InterruptedExcept public void load(File... sources) throws InterruptedException { try (CombinedFileAccess combinedSources = new CombinedFileAccess()){ for (int i = 0; i < sources.length; i++) { + if (Thread.interrupted()) throw new InterruptedException(); + File file = sources[i]; try { combinedSources.addFileAccess(FileAccess.of(file)); @@ -152,6 +154,8 @@ public void load(File... sources) throws InterruptedException { Collection namespaces = sourcesAccess.listFolders("assets"); int i = 0; for (String namespaceRoot : namespaces) { + if (Thread.interrupted()) throw new InterruptedException(); + i++; //load blockstates @@ -160,10 +164,7 @@ public void load(File... sources) throws InterruptedException { Collection blockstateFiles = sourcesAccess.listFiles(namespaceRoot + "/blockstates", true); for (String blockstateFile : blockstateFiles) { - if (Thread.interrupted()) { - Thread.currentThread().interrupt(); - return; - } + if (Thread.interrupted()) throw new InterruptedException(); String filename = FileAccess.getFileName(blockstateFile); if (!filename.endsWith(".json")) continue;