Improves writing speed when not using a GUI
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
Uses buffered writers instead of System.out Uses a GUI for writing JarBuilder messages Adds some missing comments to the jar builder
This commit is contained in:
@ -1,19 +1,30 @@
|
||||
package net.knarcraft.minecraftserverlauncher.userinterface;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
public class FakeGUI extends MessageHandler implements GUI {
|
||||
|
||||
private final BufferedWriter writer;
|
||||
|
||||
/***
|
||||
* Initializes a new fake gui
|
||||
*/
|
||||
public FakeGUI() {
|
||||
super(true);
|
||||
this.writer = new BufferedWriter(new OutputStreamWriter(System.out));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatus(String message) {
|
||||
System.out.println(message);
|
||||
try {
|
||||
writer.write(message);
|
||||
writer.flush();
|
||||
} catch (IOException e) {
|
||||
System.out.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user