java doesnt need downloading for now, running jar works
This commit is contained in:
parent
5b321f0d40
commit
0522f0aae1
3 changed files with 11 additions and 3 deletions
|
@ -35,6 +35,9 @@ dependencies {
|
||||||
// Coroutines core
|
// Coroutines core
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-javafx:1.7.0"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-javafx:1.7.0"
|
||||||
|
|
||||||
|
// Archiver
|
||||||
|
implementation "org.rauschig:jarchivelib:1.2.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package xyz.brysonsteck.serverfordummies
|
||||||
|
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.javafx.JavaFx
|
import kotlinx.coroutines.javafx.JavaFx
|
||||||
|
import org.rauschig.jarchivelib.*
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
@ -43,6 +44,7 @@ import javafx.stage.DirectoryChooser
|
||||||
import javafx.stage.Modality
|
import javafx.stage.Modality
|
||||||
import javafx.stage.Stage
|
import javafx.stage.Stage
|
||||||
import javafx.event.EventHandler
|
import javafx.event.EventHandler
|
||||||
|
|
||||||
import Download
|
import Download
|
||||||
|
|
||||||
class PrimaryController {
|
class PrimaryController {
|
||||||
|
@ -164,7 +166,6 @@ class PrimaryController {
|
||||||
GlobalScope.launch(Dispatchers.Default) {
|
GlobalScope.launch(Dispatchers.Default) {
|
||||||
progressBar.isVisible = true
|
progressBar.isVisible = true
|
||||||
var downloads = mapOf(
|
var downloads = mapOf(
|
||||||
"Java 20" to "https://download.java.net/java/GA/jdk20.0.1/b4887098932d415489976708ad6d1a4b/9/GPL/openjdk-20.0.1_linux-x64_bin.tar.gz",
|
|
||||||
"BuildTools" to "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar",
|
"BuildTools" to "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar",
|
||||||
)
|
)
|
||||||
downloads.forEach {
|
downloads.forEach {
|
||||||
|
@ -197,7 +198,11 @@ class PrimaryController {
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private fun onStart() {
|
private fun onStart() {
|
||||||
|
statusBar.text = "The Minecraft Server is now running. Shutdown the server to unlock the settings."
|
||||||
|
@Suppress("OPT_IN_USAGE")
|
||||||
|
GlobalScope.launch(Dispatchers.Default) {
|
||||||
|
val proc = Runtime.getRuntime().exec("java -jar /home/bryson/test/testserver/server.jar");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createDialog(type: String, msg: String, yes: String, no: String) {
|
private fun createDialog(type: String, msg: String, yes: String, no: String) {
|
||||||
|
|
|
@ -221,7 +221,7 @@
|
||||||
<ButtonBar fx:id="buttonBar" disable="true" layoutY="635.0" prefHeight="40.0" prefWidth="963.0">
|
<ButtonBar fx:id="buttonBar" disable="true" layoutY="635.0" prefHeight="40.0" prefWidth="963.0">
|
||||||
<buttons>
|
<buttons>
|
||||||
<Button fx:id="buildButton" mnemonicParsing="false" onMouseClicked="#onBuild" text="Build Server" />
|
<Button fx:id="buildButton" mnemonicParsing="false" onMouseClicked="#onBuild" text="Build Server" />
|
||||||
<Button fx:id="startButton" defaultButton="true" mnemonicParsing="false" prefWidth="120.0" text="Start Server" />
|
<Button fx:id="startButton" defaultButton="true" mnemonicParsing="false" prefWidth="120.0" onMouseClicked="#onStart" text="Start Server" />
|
||||||
</buttons>
|
</buttons>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
|
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue