Hi! I see web I think doing it posible: https://discourse.codeemo.com/t/minecraft-forge-1-18-1-no-targetable-jar/5200
But I don't know how to add this argument to get it working.
@user_jvm_args.txt @libraries/net/minecraftforge/forge/1.18.1-39.0.64/unix_args.txt
Or after it in the post can see a linux command to generate forge with .jar.
This is the code to put into the next function block to copy the jar and update the config with the jarfile and java_tweaks.
var runPath = `${self.env.cwd}/run.sh`; //set the runPath to location of run.sh
if(sc.java.jarfile.includes('forge') && sc.java.jarfile.includes('installer') && fs.existsSync(runPath)){ //if the selcted jar has forge and installer in the name and the run.sh exists
var run = fs.readFileSync(runPath, 'utf8').split('\n').filter(line => line.charAt(0) !== '#' && line !== '')[0]; //read the run.sh and just get the executable line
var unixArgsLoc = run.split('@')[2].split('unix_args.txt')[0];
var unix_args = `@${unixArgsLoc}unix_args.txt`; //get the unix_args.txt location
var dir = fs.readdirSync(`${self.env.cwd}/${unixArgsLoc}`).filter(elm=> elm.includes('universal'));
var universal = `${self.env.cwd}/${unixArgsLoc}${dir[0]}`;
fs.copyFileSync(universal, `${self.env.cwd}/${dir[0]}`);
self.modify_sc('java','jarfile',dir[0])
self.modify_sc('java','java_tweaks',unix_args);
}
The idea of this is that it would run automatically after running a forge installer jar. I just tried it, after running the installer jar, refreshed the page and saw that the java_args bit was there. Clicked start and it booted up.
__
Third option is another callback function in the chain that pretty much does the same thing. I am thinking that separating things into a handler class or separating the functions into separate files or something might be able to reduce the size of the monolith that is mineos.js
function(err,cb){
// in theory this will only run if the launch jar is forge*installer.jar and the run.sh has been generated. (meaning this could be run multiple times)
var runPath = `${self.env.cwd}/run.sh`; //set the runPath to location of run.sh
if(sc.java.jarfile.includes('forge') && sc.java.jarfile.includes('installer') && fs.existsSync(runPath)){ //if the selcted jar has forge and installer in the name and the run.sh exists
var binary = which.sync('screen');
var run = fs.readFileSync(runPath, 'utf8').split('\n').filter(line => line.charAt(0) !== '#' && line !== '')[0]; //read the run.sh and just get the executable line
var unixArgsLoc = run.split('@')[2].split('unix_args.txt')[0];
var unix_args = `@${unixArgsLoc}unix_args.txt`; //get the unix_args.txt location
var dir = fs.readdirSync(`${self.env.cwd}/${unixArgsLoc}`).filter(elm=> elm.includes('universal'));
var universal = `${self.env.cwd}/${unixArgsLoc}${dir[0]}`;
fs.copyFileSync(universal, `${self.env.cwd}/${dir[0]}`);
self.modify_sc('java','jarfile',dir[0]);
self.modify_sc('java','java_tweaks',unix_args);
self.modify_sc('java','java_xmx', '1024');
cb();
} else {
cb();
}
}
And other reply it is working.
I don't know how to do any of this options.
____
And I see this tutorial too but don't know how to:
https://www.multicraft.org/site/docs/howto#9.9
Any can help me?