Skip to content

Commit

Permalink
Load doom on runtime asw
Browse files Browse the repository at this point in the history
  • Loading branch information
ReclipseTheOne committed Dec 12, 2024
1 parent 81be472 commit 9677d27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ configurations {

dependencies {
implementation project(':doom')
additionalRuntimeClasspath project(':doom')
}

// This block of code expands all declared replace properties in the specified resource targets.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.portingdeadmods.doomstation;

import com.portingdeadmods.doomstation.registry.RegisterStuff;
import net.minecraft.CrashReport;
import net.minecraft.client.Minecraft;
import org.slf4j.Logger;
import com.mojang.logging.LogUtils;
import net.neoforged.bus.api.IEventBus;
Expand All @@ -19,18 +21,20 @@ public DSMain(IEventBus modEventBus, ModContainer modContainer) throws IOExcepti
RegisterStuff.CREATIVE_MODE_TABS.register(modEventBus);
RegisterStuff.ITEMS.register(modEventBus);
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();

Thread doomThread = new Thread(() -> {
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
mochadoom.Engine.main(new String[]{});
System.out.println("Engine started");
LOGGER.info("MochaDoom Engine started");
} catch (IOException e) {
e.printStackTrace();
} finally {
Thread.currentThread().setContextClassLoader(originalClassLoader);
}
});
doomThread.start();

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

Expand Down

0 comments on commit 9677d27

Please sign in to comment.