complete rename to ServerCraft
This commit is contained in:
parent
8fbd006b49
commit
13c4c1cfc0
16 changed files with 28 additions and 28 deletions
|
@ -42,7 +42,7 @@ dependencies {
|
|||
|
||||
application {
|
||||
// Define the main class for the application.
|
||||
mainClass = 'xyz.brysonsteck.serverfordummies.MainKt'
|
||||
mainClass = 'xyz.brysonsteck.servercraft.MainKt'
|
||||
}
|
||||
|
||||
jar {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This Kotlin source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
package xyz.brysonsteck.serverfordummies
|
||||
package xyz.brysonsteck.servercraft
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
|
@ -17,7 +17,7 @@ class App : Application() {
|
|||
var scene = Scene(loadFXML("primary"), 963.0, 713.0)
|
||||
stage.icons.add(Image(this.javaClass.getResourceAsStream("app.png")))
|
||||
stage.setResizable(false)
|
||||
stage.title = "Server For Dummies"
|
||||
stage.title = "ServerCraft"
|
||||
stage.scene = scene
|
||||
stage.show()
|
||||
}
|
5
app/src/main/kotlin/xyz/brysonsteck/servercraft/Main.kt
Normal file
5
app/src/main/kotlin/xyz/brysonsteck/servercraft/Main.kt
Normal file
|
@ -0,0 +1,5 @@
|
|||
package xyz.brysonsteck.servercraft
|
||||
|
||||
fun main() {
|
||||
App().run()
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package xyz.brysonsteck.serverfordummies.controllers
|
||||
package xyz.brysonsteck.servercraft.controllers
|
||||
|
||||
import javafx.fxml.FXML
|
||||
import javafx.application.Platform
|
|
@ -1,4 +1,4 @@
|
|||
package xyz.brysonsteck.serverfordummies.controllers
|
||||
package xyz.brysonsteck.servercraft.controllers
|
||||
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.javafx.JavaFx
|
||||
|
@ -52,9 +52,9 @@ import javafx.stage.Stage
|
|||
import javafx.event.EventHandler
|
||||
import org.rauschig.jarchivelib.*
|
||||
|
||||
import xyz.brysonsteck.serverfordummies.server.Server
|
||||
import xyz.brysonsteck.serverfordummies.server.Download
|
||||
import xyz.brysonsteck.serverfordummies.App
|
||||
import xyz.brysonsteck.servercraft.server.Server
|
||||
import xyz.brysonsteck.servercraft.server.Download
|
||||
import xyz.brysonsteck.servercraft.App
|
||||
|
||||
class PrimaryController {
|
||||
@FXML
|
||||
|
@ -265,8 +265,8 @@ class PrimaryController {
|
|||
"BuildTools" to "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar",
|
||||
)
|
||||
val destinations = mapOf (
|
||||
"Java 20" to directory + "ServerForDummies" + File.separator + "Java" + File.separator,
|
||||
"BuildTools" to directory + "ServerForDummies" + File.separator + "Spigot" + File.separator
|
||||
"Java 20" to directory + "ServerCraft" + File.separator + "Java" + File.separator,
|
||||
"BuildTools" to directory + "ServerCraft" + File.separator + "Spigot" + File.separator
|
||||
)
|
||||
val spigotBuilt = File(destinations["BuildTools"]).exists()
|
||||
val javaExtracted = File(destinations["Java 20"] + "jdk-20.0.1").exists()
|
||||
|
@ -301,13 +301,13 @@ class PrimaryController {
|
|||
progressBar.progress = ProgressBar.INDETERMINATE_PROGRESS
|
||||
statusBar.text = "Extracting Java archive..."
|
||||
}
|
||||
var stream = archiver.stream(File(directory + "ServerForDummies" + File.separator + "Java" + File.separator + javaFile))
|
||||
val dest = File(directory + "ServerForDummies" + File.separator + "Java")
|
||||
var stream = archiver.stream(File(directory + "ServerCraft" + File.separator + "Java" + File.separator + javaFile))
|
||||
val dest = File(directory + "ServerCraft" + File.separator + "Java")
|
||||
var entries = 0.0
|
||||
while(stream.getNextEntry() != null && building) {
|
||||
entries++
|
||||
}
|
||||
stream = archiver.stream(File(directory + "ServerForDummies" + File.separator + "Java" + File.separator + javaFile))
|
||||
stream = archiver.stream(File(directory + "ServerCraft" + File.separator + "Java" + File.separator + javaFile))
|
||||
var entry = stream.getNextEntry()
|
||||
var currentEntry = 0.0
|
||||
do {
|
||||
|
@ -324,7 +324,7 @@ class PrimaryController {
|
|||
statusBar.text = "Building Minecraft Server..."
|
||||
}
|
||||
val builder = ProcessBuilder("java", "-jar", "BuildTools.jar", "--rev", "latest", "-o", ".." + File.separator + ".." + File.separator)
|
||||
builder.directory(File(directory + "ServerForDummies" + File.separator + "Spigot"))
|
||||
builder.directory(File(directory + "ServerCraft" + File.separator + "Spigot"))
|
||||
val proc = builder.start()
|
||||
val reader = InputStreamReader(proc.inputStream)
|
||||
val br = BufferedReader(reader)
|
||||
|
@ -566,7 +566,7 @@ class PrimaryController {
|
|||
if (directory[directory.length-1] != File.separatorChar)
|
||||
directory += File.separatorChar
|
||||
|
||||
val hasDummy = File(directory + "ServerForDummies").isDirectory
|
||||
val hasDummy = File(directory + "ServerCraft").isDirectory
|
||||
val hasProperties = File(directory + File.separator + "server.properties").isFile
|
||||
val hasServer = findServerJar()
|
||||
|
||||
|
@ -581,7 +581,7 @@ class PrimaryController {
|
|||
statusBar.text = "Server needs to be built before starting."
|
||||
} else if (!hasDummy && hasServer) {
|
||||
// server created externally
|
||||
val result = createDialog("warning", "This server directory was not created by \nServerForDummies. Errors may occur; copying\nthe world directories to a new folder may be\nsafer. Proceed anyway?", "Yes", "No", true)
|
||||
val result = createDialog("warning", "This server directory was not created by \nServerCraft. Errors may occur; copying\nthe world directories to a new folder may be\nsafer. Proceed anyway?", "Yes", "No", true)
|
||||
statusBar.text = "Ready."
|
||||
if (result) {
|
||||
startButton.isDisable = false
|
||||
|
@ -591,7 +591,7 @@ class PrimaryController {
|
|||
// assume clean directory
|
||||
val result = createDialog("info", "There is no server in this directory.\nCreate one?", "Yes", "No", true)
|
||||
if (result) {
|
||||
File(directory + "ServerForDummies").mkdir()
|
||||
File(directory + "ServerCraft").mkdir()
|
||||
startButton.isDisable = true
|
||||
buildButton.text = "Build Server"
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package xyz.brysonsteck.serverfordummies.server
|
||||
package xyz.brysonsteck.servercraft.server
|
||||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
|
@ -1,4 +1,4 @@
|
|||
package xyz.brysonsteck.serverfordummies.server
|
||||
package xyz.brysonsteck.servercraft.server
|
||||
|
||||
import java.io.File
|
||||
import java.util.Properties
|
|
@ -1,5 +0,0 @@
|
|||
package xyz.brysonsteck.serverfordummies
|
||||
|
||||
fun main() {
|
||||
App().run()
|
||||
}
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
@ -15,7 +15,7 @@
|
|||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="358.0" prefWidth="398.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xyz.brysonsteck.serverfordummies.controllers.InfoController">
|
||||
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="358.0" prefWidth="398.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xyz.brysonsteck.servercraft.controllers.InfoController">
|
||||
<children>
|
||||
<ImageView fitHeight="115.0" fitWidth="92.0" layoutX="30.0" layoutY="30.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
|
@ -20,7 +20,7 @@
|
|||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<Pane fx:id="primary" maxHeight="713.0" maxWidth="963.0" minHeight="713.0" minWidth="963.0" prefHeight="713.0" prefWidth="963.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xyz.brysonsteck.serverfordummies.controllers.PrimaryController">
|
||||
<Pane fx:id="primary" maxHeight="713.0" maxWidth="963.0" minHeight="713.0" minWidth="963.0" prefHeight="713.0" prefWidth="963.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xyz.brysonsteck.servercraft.controllers.PrimaryController">
|
||||
<children>
|
||||
<HBox fx:id="directoryPane" prefHeight="39.0" prefWidth="963.0">
|
||||
<children>
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This Kotlin source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
package xyz.brysonsteck.serverfordummies
|
||||
package xyz.brysonsteck.servercraft
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertNotNull
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
* in the user manual at https://docs.gradle.org/8.0.2/userguide/multi_project_builds.html
|
||||
*/
|
||||
|
||||
rootProject.name = 'serverfordummies'
|
||||
rootProject.name = 'servercraft'
|
||||
include('app')
|
||||
|
|
Loading…
Add table
Reference in a new issue