It is currently 25 Apr 2024, 16:28
   
Text Size

Running Simulation Mode programatically

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Running Simulation Mode programatically

Postby AronaDaal » 06 Oct 2020, 20:23

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?
AronaDaal
 
Posts: 1
Joined: 06 Oct 2020, 20:14
Has thanked: 0 time
Been thanked: 0 time

Return to Forge

Who is online

Users browsing this forum: No registered users and 140 guests


Who is online

In total there are 140 users online :: 0 registered, 0 hidden and 140 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 140 guests

Login Form