diff --git a/common/src/main/java/com/iafenvoy/sow/compat/LitematicaHelper.java b/common/src/main/java/com/iafenvoy/sow/compat/LitematicaHelper.java index beddb88..19d1b9a 100644 --- a/common/src/main/java/com/iafenvoy/sow/compat/LitematicaHelper.java +++ b/common/src/main/java/com/iafenvoy/sow/compat/LitematicaHelper.java @@ -1,8 +1,10 @@ package com.iafenvoy.sow.compat; import com.iafenvoy.sow.SongsOfWar; +import org.apache.commons.io.FileUtils; import java.io.*; +import java.nio.file.Path; import java.util.List; public class LitematicaHelper { @@ -10,11 +12,13 @@ public class LitematicaHelper { private static final List FILES = List.of("shrine.litematic"); public static void extractFile() { + if(!new File(EXTRACT_PATH).mkdirs()) + SongsOfWar.LOGGER.error("Failed to create folder {}.", EXTRACT_PATH); for (String file : FILES) { try { write2File(LitematicaHelper.class.getResourceAsStream("/litematica/" + file), EXTRACT_PATH + file); } catch (Exception e) { - SongsOfWar.LOGGER.error("Failed to extract litematica fila {}.", file, e); + SongsOfWar.LOGGER.error("Failed to extract litematica file {}.", file, e); } } }