I am doing some research on how to write a Minecraft server wrapper
program. Right now I run a minecraft server with the
minecraft_server.jar file from Minecraft.net. When I want to execute
complex commands I usually draft them in a text editor and copy and
paste them into my Mac's terminal where the server is running. This
more tedious than I would like it to be, so I have decided to see if
it would be feasible to write a program that will run the server and
read to the server commands that I have composed in a file. I think
this is basically like enabling me to make scripts for my server.
Here is an illustration of the basic idea. I would communicate with
the server wrapper program, and the server wrapper program would
communicate with the server sending it my commands and also running
scripts of commands for me.
Here is a sketch of the GUI I would like to build. It would show
the normal server output which currently is fed to the console window
running the server. It also has a field for allowing me to run
commands as usual. Next there is a selectable list of scripts, a
button that prompts the user for a script, and a button that will run
the selected script.
There may be programs out there on the internet that already do
this type of thing, but I am interested in writing this to practice my
programming/Java skills. Some classes that I think I will be using are
JFrame, other Swing stuff,
Write now I have three classes:
- ServerOutputThread, and
MinecraftServerWrapper is the main class which uses
ProcessBuilder to execute
then it creates a ServerOutputThread instance and a
ServerInputThread instance which take in the process and
access its input and output streams to read from
System.in and write to the server's input stream and take
the server's output stream and writes it to
My next step is to send that output to a GUI and be able to use the
GUI to send the input to the server.
Question: I am primarily concerned about how much this
kind of application can handle, i.e., how long of scripts could it
handle at once. Does this approach seem reasonable, or does it seem
like I might be missing something conceptually?