From 6bdae39915e9ba2ade66e0af326ae0c0b3289b93 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 26 Feb 2020 01:30:11 +0100 Subject: [PATCH] Fix sprite unpack, launching V1 --- .../leveleditor/api/editor/sprites/SpriteRegister.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.java b/src/main/java/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.java index d4c9215..e49db42 100644 --- a/src/main/java/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.java +++ b/src/main/java/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.java @@ -41,9 +41,10 @@ public class SpriteRegister { String name = je.getName(); if (name.startsWith("assets/")) { File f = new File(name); - if (name.endsWith("/") && !f.isDirectory()) - if (!f.mkdirs()) - throw new IOException("Unable to create make dir: " + f); + if (name.endsWith("/")) { + if (!f.mkdirs() && !f.isDirectory()) + throw new IOException("Unable to make dir: " + f); + } else if (!f.isFile()) Files.copy(jar.getInputStream(je), Paths.get(f.toURI())); }