I'm trying to create a "wrapper" in java that launches the minecraft_server.jar process, then captures the STDIN, and feeds a string to it that says "save-all" every 10 minutes. The save-all command simply saves the server's map.
I am not experienced in java, I'm a beginner at python. I understand some basics.
A friend said I needed this to launch the minecraft_server.jar:
Process p = Runtime.getRuntime().exec("java -Xmx" + options.memory + "M -Xms" + 1024 + "M -jar minecraft_server.jar nogui");
Thread t = new Thread(new ErrorStreamRouter(p.getErrorStream()));
Thread t2 = new Thread(new ErrorStreamRouter(p.getInputStream()));
Thread t3 = new Thread(input=new InputStreamRouter(System.in,p.getOutputStream()));
No idea how to turn this into an actually executable program. Also, I don't know how to make the 10 minute loop for save-all.
Any help or guidance is appreciated.


Sign In
Create Account

Back to top









