Page 1 of 1

Running Simulation Mode programatically

PostPosted: 06 Oct 2020, 20:23
by AronaDaal
Hello! I have been working on a project where I build a deck and run a simulation, change, run again, etc. My desire is to run the simulator programmatically. I have attempted a few things to no avail:
1. I have the forge-gui-desktop-1.6.36-jar-with-dependencies.jar in my project was able to access the function:
Code: Select all
SimulateMatch.simulate(args);
where I pass in the correct args. However, I run into a NPE. Then I tried running from:
Code: Select all
Main.main(args)
since I saw some init blocks. Again, I run into a NPE.

I figure this is because it needs some dependencies to be initialized first, hence the jar file with dependencies.

2. So I attempted to execute the jar file in the code, however, I have been very unsuccessful trying to execute a jar file programmatically.

So I was hoping, how can I get solution #1 to work? Is there a function I can call to make sure things are initialized before executing the sim mode?