Skip to content

Commit 9ffa3e2

Browse files
committed
Fix error when loading project with custom actions. Not detecting no
compiled project properly.
1 parent 5eb1dc8 commit 9ffa3e2

File tree

1 file changed

+4
-2
lines changed
  • adventure-editor/src/main/java/com/bladecoder/engineeditor/model

1 file changed

+4
-2
lines changed

adventure-editor/src/main/java/com/bladecoder/engineeditor/model/Project.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,12 @@ public void loadChapter(String selChapter) throws IOException {
462462
chapter.load(selChapter);
463463
} catch (SerializationException ex) {
464464
// check for not compiled custom actions
465-
if (ex.getCause() != null && ex.getCause().getCause() != null
466-
&& ex.getCause().getCause() instanceof ClassNotFoundException) {
465+
if (ex.getCause() != null && ex.getCause() instanceof ClassNotFoundException) {
467466
EditorLogger.debug("Custom action class not found. Trying to compile...");
468467
if (RunProccess.runGradle(Ctx.project.getProjectDir(), "desktop:compileJava")) {
468+
FolderClassLoader folderClassLoader = new FolderClassLoader(projectFile.getAbsolutePath()
469+
+ "/core/build/classes/main");
470+
ActionFactory.setActionClassLoader(folderClassLoader);
469471
chapter.load(selChapter);
470472
} else {
471473
throw new IOException("Failed to run Gradle.");

0 commit comments

Comments
 (0)