diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt | 15 | ||||
-rw-r--r-- | src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml | 16 |
2 files changed, 22 insertions, 9 deletions
diff --git a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt index 5b26481..75ebbbd 100644 --- a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt +++ b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt @@ -494,23 +494,32 @@ class PrimaryController { builder.directory(File(directory + "ServerCraft" + File.separator + "Spigot")) val proc = builder.start() val reader = InputStreamReader(proc.inputStream) + val errors = InputStreamReader(proc.errorStream) val br = BufferedReader(reader) + val ebr = BufferedReader(errors) try { var line = br.readLine() + var errorLine = ebr.readline() var currentline = 0.0 - while (line != null) { + while (line != null || errorLine != null) { if (!building) { proc.destroy() } - withContext(Dispatchers.JavaFx) {log(line)} + withContext(Dispatchers.JavaFx) { + if (errorLine != null) { + log(errorLine) + } + log(line) + } line = br.readLine() + errorLine = ebr.readline() currentline++ if (currentline > 15) { withContext(Dispatchers.JavaFx) {progressBar.progress = if (spigotBuilt) {currentline/1100.0} else {currentline/14122.0} } } } } catch (e: IOException) { - withContext(Dispatchers.JavaFx) {log("Stream Closed")} + withContext(Dispatchers.JavaFx) {log("Stream Closed: ${e.toString()}")} } } diff --git a/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml b/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml index f0b73f3..a4d561a 100644 --- a/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml +++ b/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml @@ -36,20 +36,24 @@ <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" /> </padding> </ButtonBar> - <Label layoutX="52.0" layoutY="135.0" text="A graphical interface for creating Minecraft servers" textAlignment="CENTER" /> - <TabPane layoutY="158.0" prefHeight="161.0" prefWidth="398.0" stylesheets="@css/info-tabs.css" tabClosingPolicy="UNAVAILABLE"> + <Label alignment="CENTER" layoutX="1.0" layoutY="135.0" prefHeight="15.0" prefWidth="398.0" text="A graphical interface for creating Minecraft servers" textAlignment="CENTER" /> + <TabPane layoutY="158.0" prefHeight="166.0" prefWidth="398.0" stylesheets="@css/info-tabs.css" tabClosingPolicy="UNAVAILABLE"> <tabs> <Tab text="About"> <content> - <Pane prefHeight="200.0" prefWidth="200.0"> + <Pane prefHeight="200.0" prefWidth="398.0"> <children> <Label alignment="TOP_LEFT" prefWidth="398.0" text="This program is for simple Minecraft servers, and expects that the user knows how to port forward. ServerCraft is free and open source under the GNU General Public License Version 3.0" wrapText="true"> <padding> <Insets bottom="13.0" left="13.0" right="13.0" top="13.0" /> </padding> </Label> - <Hyperlink fx:id="license" layoutX="127.0" layoutY="110.0" onAction="#openHyperlink" text="License" /> - <Hyperlink fx:id="source" layoutX="189.0" layoutY="110.0" onAction="#openHyperlink" text="Source Code" /> + <HBox alignment="CENTER" layoutY="106.0" prefHeight="21.0" prefWidth="398.0"> + <children> + <Hyperlink fx:id="license" onAction="#openHyperlink" text="License" /> + <Hyperlink fx:id="source" onAction="#openHyperlink" text="Source Code" /> + </children> + </HBox> </children> <padding> <Insets bottom="13.0" left="13.0" right="13.0" top="13.0" /> @@ -61,7 +65,7 @@ <content> <Pane prefHeight="200.0" prefWidth="200.0"> <children> - <Label layoutX="78.0" layoutY="109.0" text="Want to join the list? Contribute with a PR!" textAlignment="CENTER" /> + <Label alignment="CENTER" layoutY="109.0" prefHeight="15.0" prefWidth="398.0" text="Want to join the list? Contribute with a PR!" textAlignment="CENTER" /> <VBox> <children> <Label text="Bryson Steck" VBox.vgrow="ALWAYS"> |