Skip to content

Commit

Permalink
separate processes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Dec 12, 2024
1 parent 255a544 commit 6c88c8a
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions neoforge/src/main/java/com/portingdeadmods/doomstation/DSMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.neoforged.fml.common.Mod;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;

@Mod(DSMain.MODID)
public class DSMain
Expand All @@ -22,15 +23,23 @@ public DSMain(IEventBus modEventBus, ModContainer modContainer) throws IOExcepti

System.setProperty("java.awt.headless", "false");

new Thread(() -> {
try {
Engine.main(new String[]{});
} catch (IOException e) {
e.printStackTrace();
}
}).start();
startDoom();

//modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
}


public static void startDoom(){
ProcessBuilder processBuilder = new ProcessBuilder(
"java", "-cp", System.getProperty("java.class.path"), "mochadoom.Engine"
);
processBuilder.inheritIO();
try {
processBuilder.start();
} catch (IOException e) {
LOGGER.error("Error starting Doom process", e);
}
}


}

0 comments on commit 6c88c8a

Please sign in to comment.