diff --git a/README.md b/README.md index 55da83912..2157f3f97 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![banner](https://i.griefed.de/images/2021/03/03/serverpackcreator_banner.png)](https://github.com/Griefed/ServerPackCreator) +[![banner](img/serverpackcreator_banner.png)](https://github.com/Griefed/ServerPackCreator) [![Homepage](https://img.shields.io/badge/Griefed.de-Homepage-c0ffee?style=for-the-badge&labelColor=325358&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACylBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v7+/v6OsnIvAAAA7XRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiQlJicoKSorLC0uLzAxMjU2Nzg5Ojs8Pj9AQUJERUZHSElLTE9QUVJTVFVWV1hZXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SGh4iJiou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k4n708FEvdyJlgEYqis2tmhE+dGDZr/dl0KxR8f3KqN49yCTyAkg7kVLNvgHh72YViAd9Z81JMLcakAp+bkFM+RbCsMxLn1Wnism1Hjh/YsSp2ZMtqjIjq7LW+9SWnqrzODjCQijFGPxiC71Ynp/RJrZnjehzZ+Q9fNggLmTcf8AAAAABJRU5ErkJggg==)](https://www.griefed.de) [![Blog](https://img.shields.io/badge/Griefed.de-Blog-c0ffee?style=for-the-badge&labelColor=325358&logo=wordpress)](https://blog.griefed.de) @@ -24,7 +24,7 @@ release distribution. [![GitHub forks](https://img.shields.io/github/forks/Griefed/serverpackcreator?label=GitHub%20Forks&style=for-the-badge&logo=Github&labelColor=325358&color=c0ffee)](https://github.com/Griefed/ServerPackCreator) [![GitHub contributors](https://img.shields.io/github/contributors/Griefed/ServerPackCreator?color=c0ffee&label=Contributors&logo=GitHub&logoColor=white&style=for-the-badge&labelColor=325358)](https://github.com/Griefed/ServerPackCreator/graphs/contributors) -**ServerPackCreator creates a server pack from any given Forge, Fabric, Quilt or LegacyFabric modpack.** +**ServerPackCreator creates a server pack from any given Forge, Fabric, Quilt, LegacyFabric and NeoForge modpack.** **Whenever you are working on an update to your modpack, you simply run ServerPackCreator and BAM! You've got yourself a server pack for your new modpack version.** @@ -41,7 +41,7 @@ into the world of programming. And here we are. ##### Required: -* Using the JAR-file release requires Java 17. +* Using the JAR-file release requires Java 21. * Working internet connection recommended. ##### Note: @@ -141,6 +141,7 @@ ServerPackCreator also has a webservice which you can run with the `-web`-argume - **Fabric** - **LegacyFabric** - **Quilt** + - **NeoForge** 6. Use Minecraft **snapshots** and **pre-releases** - Per default, only regular releases enabled 7. Let ServerPackCreator **install the modloader-server** for your server pack, for immediate testing and debugging after generation! diff --git a/build.gradle.kts b/build.gradle.kts index 13e447b76..3b93b257c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,8 @@ import de.griefed.common.gradle.LicenseAgreementRenderer import de.griefed.common.gradle.SubprojectLicenseFilter import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel +import java.io.FileInputStream +import java.util.* plugins { idea @@ -9,15 +11,20 @@ plugins { id("com.github.jk1.dependency-license-report") } +val props = Properties() +FileInputStream(file("gradle.properties")).use { + props.load(it) +} + idea { project { - languageLevel = IdeaLanguageLevel("17") - jdkName = "17" + languageLevel = IdeaLanguageLevel(props.getProperty("jdkVersion")) + jdkName = props.getProperty("jdkVersion") modules.forEach { it.isDownloadJavadoc = true it.isDownloadSources = true - it.languageLevel = IdeaLanguageLevel("17") - it.jdkName = "17" + it.languageLevel = IdeaLanguageLevel(props.getProperty("jdkVersion")) + it.jdkName = props.getProperty("jdkVersion") } } } @@ -58,7 +65,7 @@ licenseReport { SubprojectLicenseFilter() ) - renderers = arrayOf( + renderers = arrayOf( com.github.jk1.license.render.InventoryHtmlReportRenderer("index.html", "Dependency Licences"), com.github.jk1.license.render.InventoryMarkdownReportRenderer("licences.md", "Dependency Licenses"), LicenseAgreementRenderer("LICENSE-AGREEMENT") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2ca342b72..5ef0725c6 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -35,9 +35,6 @@ dependencies { tasks.compileKotlin { logger.lifecycle("Configuring $name with version ${project.getKotlinPluginVersion()} in project ${project.name}") kotlinOptions { - val list = freeCompilerArgs.toMutableList() - list.add("-Xjsr305=strict") - freeCompilerArgs = list.toList() allWarningsAsErrors = false jvmTarget = props.getProperty("jdkVersion") languageVersion = props.getProperty("kotlinMajor") @@ -48,9 +45,6 @@ tasks.compileKotlin { tasks.compileTestKotlin { logger.lifecycle("Configuring $name with version ${project.getKotlinPluginVersion()} in project ${project.name}") kotlinOptions { - val list = freeCompilerArgs.toMutableList() - list.add("-Xjsr305=strict") - freeCompilerArgs = list.toList() allWarningsAsErrors = false jvmTarget = props.getProperty("jdkVersion") languageVersion = props.getProperty("kotlinMajor") diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index f2df7e9c1..5b0f30c92 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,3 +1,3 @@ plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0") + id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0") } diff --git a/buildSrc/src/main/kotlin/de/griefed/common/gradle/SubprojectLicenseFilter.kt b/buildSrc/src/main/kotlin/de/griefed/common/gradle/SubprojectLicenseFilter.kt index 93e020e0c..be36f57b3 100644 --- a/buildSrc/src/main/kotlin/de/griefed/common/gradle/SubprojectLicenseFilter.kt +++ b/buildSrc/src/main/kotlin/de/griefed/common/gradle/SubprojectLicenseFilter.kt @@ -2,10 +2,6 @@ package de.griefed.common.gradle import com.github.jk1.license.ModuleData import com.github.jk1.license.ProjectData -import com.github.jk1.license.filter.LicenseBundleNormalizer -import com.github.jk1.license.render.CsvReportRenderer -import com.github.jk1.license.render.InventoryHtmlReportRenderer -import com.github.jk1.license.render.ReportRenderer /** * Fix for https://github.com/jk1/Gradle-License-Report/issues/187
@@ -13,7 +9,7 @@ import com.github.jk1.license.render.ReportRenderer */ class SubprojectLicenseFilter : com.github.jk1.license.filter.DependencyFilter { override fun filter(source: ProjectData): ProjectData { - val firstLevelDependencies = source.project.subprojects.flatMap { + val firstLevelDependencies = source.project.subprojects.flatMap { it -> it.configurations.filter { it.isCanBeResolved }.flatMap { it.resolvedConfiguration.firstLevelModuleDependencies } diff --git a/buildSrc/src/main/kotlin/serverpackcreator.dokka-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.dokka-conventions.gradle.kts index 150635e99..ded4be0d6 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.dokka-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.dokka-conventions.gradle.kts @@ -11,7 +11,7 @@ repositories { } tasks.withType().configureEach { - outputDirectory.set(buildDir.resolve("dokka")) + outputDirectory.set(layout.buildDirectory.asFile.get().resolve("dokka")) dokkaSourceSets { configureEach { documentedVisibilities.set( diff --git a/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts index 3ee640b36..bda2196c8 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.java-conventions.gradle.kts @@ -126,7 +126,7 @@ publishing { artifact(tasks["javadocJar"]) pom { name.set("ServerPackCreator") - description.set("ServerPackCreators API, to create server packs from Forge, Fabric, Quilt and LegacyFabric modpacks.") + description.set("ServerPackCreators API, to create server packs from Forge, Fabric, Quilt, LegacyFabric and NeoForge modpacks.") url.set("https://git.griefed.de/Griefed/ServerPackCreator") licenses { diff --git a/buildSrc/src/main/kotlin/serverpackcreator.kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.kotlin-conventions.gradle.kts index 35c45148f..7a2ab7ed1 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.kotlin-conventions.gradle.kts @@ -32,10 +32,6 @@ if (KOTLIN_VERSION != embeddedMajorAndMinorKotlinVersion) { tasks.compileKotlin { logger.lifecycle("Configuring $name with version ${project.getKotlinPluginVersion()} in project ${project.name}") kotlinOptions { - @Suppress("SpellCheckingInspection") - val list = freeCompilerArgs.toMutableList() - list.add("-Xjsr305=strict") - freeCompilerArgs = list.toList() allWarningsAsErrors = false jvmTarget = JDK_VERSION languageVersion = KOTLIN_VERSION @@ -46,10 +42,6 @@ tasks.compileKotlin { tasks.compileTestKotlin { logger.lifecycle("Configuring $name with version ${project.getKotlinPluginVersion()} in project ${project.name}") kotlinOptions { - @Suppress("SpellCheckingInspection") - val list = freeCompilerArgs.toMutableList() - list.add("-Xjsr305=strict") - freeCompilerArgs = list.toList() allWarningsAsErrors = false jvmTarget = JDK_VERSION languageVersion = KOTLIN_VERSION diff --git a/buildSrc/src/main/kotlin/serverpackcreator.kotlin-multiplatform-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.kotlin-multiplatform-conventions.gradle.kts index 551f663c4..eeb4e2fb0 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.kotlin-multiplatform-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.kotlin-multiplatform-conventions.gradle.kts @@ -17,9 +17,6 @@ kotlin { compilations.all { kotlinOptions.allWarningsAsErrors = false kotlinOptions.apiVersion = KOTLIN_VERSION - val compilerArgs = kotlinOptions.freeCompilerArgs.toMutableList() - compilerArgs.add("-Xjsr305=strict") - kotlinOptions.freeCompilerArgs = compilerArgs.toList() kotlinOptions.jvmTarget = JDK_VERSION kotlinOptions.languageVersion = KOTLIN_VERSION jvmToolchain { diff --git a/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts b/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts index 5031717dc..cbd0b7b2d 100644 --- a/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/serverpackcreator.quasar-conventions.gradle.kts @@ -1,9 +1,4 @@ -import org.gradle.api.tasks.Copy -import org.gradle.kotlin.dsl.register -import org.gradle.kotlin.dsl.repositories -import org.gradle.kotlin.dsl.version import org.siouan.frontendgradleplugin.infrastructure.gradle.RunNpm -import java.io.File plugins { id("org.siouan.frontend-jdk11") @@ -20,8 +15,6 @@ frontend { nodeInstallDirectory.set(project.layout.projectDirectory.dir("node")) yarnEnabled.set(false) - //yarnVersion = "1.22.11" - //yarnInstallDirectory = file("${projectDir}/frontend/yarn") cleanScript.set("run clean") assembleScript.set("run build") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e5832f..ccebba771 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 761b8f088..c30b486a8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 792ae6516..6689b85be 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -90,4 +90,3 @@ exit /b %EXIT_CODE% if "%OS%"=="Windows_NT" endlocal :omega - diff --git a/licenses/index.html b/licenses/index.html index e69272fea..47dd33a14 100644 --- a/licenses/index.html +++ b/licenses/index.html @@ -124,7 +124,7 @@

serverpackcreator dev

Dependency License Report

-

2023-09-19 20:46:40 MESZ.

+

2023-09-21 20:47:08 MESZ.

Dependency Licences

  • Apache License, Version 2.0 31
  • diff --git a/licenses/licences.md b/licenses/licences.md index 0d7a02e77..f0a72d6e1 100644 --- a/licenses/licences.md +++ b/licenses/licences.md @@ -1,7 +1,7 @@ # Dependency Licenses ## Dependency License Report -_2023-09-19 20:46:41 MESZ_ +_2023-09-21 20:47:08 MESZ_ ## Apache License, Version 2.0 **1** **Group:** `com.cronutils` **Name:** `cron-utils` **Version:** `9.2.1` diff --git a/serverpackcreator-api/build.gradle.kts b/serverpackcreator-api/build.gradle.kts index 0c3b1d3a1..d74ff9c5f 100644 --- a/serverpackcreator-api/build.gradle.kts +++ b/serverpackcreator-api/build.gradle.kts @@ -9,7 +9,6 @@ repositories { } kotlin { - @Suppress("UNUSED_VARIABLE") sourceSets { val commonMain by getting { dependencies { @@ -31,7 +30,7 @@ kotlin { dependencies { implementation("org.jetbrains.kotlin:kotlin-bom") implementation("org.jetbrains.kotlin:kotlin-stdlib") - implementation(files("$buildDir/resources/")) + implementation(files("${layout.buildDirectory.asFile.get()}/resources/")) api("de.comahe.i18n4k:i18n4k-core-jvm:0.5.0") api("com.electronwill.night-config:toml:3.6.6") api("com.fasterxml.jackson.core:jackson-databind:2.15.0") @@ -86,8 +85,8 @@ tasks.jvmProcessResources { //Fix resources missing in multiplatform jvm inDev run https://youtrack.jetbrains.com/issue/KTIJ-16582/Consumer-Kotlin-JVM-library-cannot-access-a-Kotlin-Multiplatform-JVM-target-resources-in-multi-module-Gradle-project tasks.register("fixMissingResources") { dependsOn(tasks.jvmProcessResources) - from("$buildDir/processedResources/jvm/main") - into("$buildDir/resources/") + from("${layout.buildDirectory.asFile.get()}/processedResources/jvm/main") + into("${layout.buildDirectory.asFile.get()}/resources/") } tasks.dokkaHtml { diff --git a/serverpackcreator-app/build.gradle.kts b/serverpackcreator-app/build.gradle.kts index 29ad88ba7..fcd7d3e89 100644 --- a/serverpackcreator-app/build.gradle.kts +++ b/serverpackcreator-app/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { api(project(":serverpackcreator-gui")) api(project(":serverpackcreator-web")) api(project(":serverpackcreator-updater")) - api("de.griefed:versionchecker:1.1.5") + api("de.griefed:versionchecker:1.1.9") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3") } @@ -42,15 +42,15 @@ tasks.clean { } task("copyDependencies", Copy::class) { - from(configurations.runtimeClasspath).into("$buildDir/jars") + from(configurations.runtimeClasspath).into("${layout.buildDirectory.asFile.get()}/jars") } task("copyJar", Copy::class) { - from(tasks.jar).into("$buildDir/jars") + from(tasks.jar).into("${layout.buildDirectory.asFile.get()}/jars") } tasks.register("cleanTmpPackager") { - delete("$buildDir/tmp/jpackager") + delete("${layout.buildDirectory.asFile.get()}/tmp/jpackager") } // https://docs.oracle.com/en/java/javase/14/docs/specs/man/jpackage.html @@ -62,7 +62,7 @@ tasks.jpackage { val ver: String = project.version.toString() dependsOn("build", "copyDependencies", "copyJar", "cleanTmpPackager") aboutUrl = "https://www.griefed.de/#/serverpackcreator" - appDescription = "Create server packs from Minecraft Forge, Fabric, Quilt or LegacyFabric modpacks." + appDescription = "Create server packs from Minecraft Forge, Fabric, Quilt, LegacyFabric and NeoForge modpacks." appName = "ServerPackCreator" appVersion = if (ver == "dev") { val current = LocalDate.now().toString().split("-") @@ -73,16 +73,16 @@ tasks.jpackage { ver } copyright = "Copyright (C) ${Calendar.getInstance().get(Calendar.YEAR)} Griefed" - destination = "$buildDir/dist" + destination = "${layout.buildDirectory.asFile.get()}/dist" icon = File(packagerResources, "app.png").path - input = "$buildDir/jars" + input = "${layout.buildDirectory.asFile.get()}/jars" javaOptions = listOf("-Dfile.encoding=UTF-8", "-Dlog4j2.formatMsgNoLookups=true") licenseFile = parent.path + "/licenses/LICENSE-AGREEMENT" mainJar = tasks.jar.get().archiveFileName.get() mainClass = "de.griefed.serverpackcreator.app.ServerPackCreatorKt" resourceDir = packagerResources.path runtimeImage = System.getProperty("java.home") - temp = "$buildDir/tmp/jpackager" + temp = "${layout.buildDirectory.asFile.get()}/tmp/jpackager" vendor = "griefed.de" verbose = true mac { diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/components/ScrollTextField.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/components/ScrollTextField.kt index 9efc35e2f..44bb34681 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/components/ScrollTextField.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/components/ScrollTextField.kt @@ -63,6 +63,13 @@ open class ScrollTextField( private val undoManager = UndoManager() val suggestionProvider: SuggestionProvider? + var isEditable: Boolean + get() { + return textField.isEditable + } + set(value) { + textField.isEditable = value + } var text: String get() { return textField.text diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/ConfigEditorTitle.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/ConfigEditorTitle.kt index 776ea5ffb..44fff550a 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/ConfigEditorTitle.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/ConfigEditorTitle.kt @@ -25,7 +25,6 @@ import de.griefed.serverpackcreator.gui.components.TabTitle import de.griefed.serverpackcreator.gui.utilities.DialogUtilities import de.griefed.serverpackcreator.gui.window.configs.ConfigEditor import de.griefed.serverpackcreator.gui.window.configs.TabbedConfigsTab -import java.awt.FlowLayout import java.awt.event.MouseAdapter import java.awt.event.MouseEvent import javax.swing.* @@ -36,7 +35,6 @@ import javax.swing.* * * @author Griefed */ -@Suppress("unused") class ConfigEditorTitle( private val guiProps: GuiProps, private val tabbedConfigsTab: TabbedConfigsTab, diff --git a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/inclusions/InclusionsEditor.kt b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/inclusions/InclusionsEditor.kt index 3fcf105d8..f2a9f775b 100644 --- a/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/inclusions/InclusionsEditor.kt +++ b/serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/configs/components/inclusions/InclusionsEditor.kt @@ -41,6 +41,8 @@ import java.io.File import java.util.regex.PatternSyntaxException import javax.swing.* import javax.swing.event.DocumentEvent +import javax.swing.event.ListDataEvent +import javax.swing.event.ListDataListener import javax.swing.event.ListSelectionEvent @@ -191,27 +193,64 @@ class InclusionsEditor( list.addMouseListener(object : MouseAdapter() { override fun mouseClicked(e: MouseEvent) { super.mouseClicked(e) - clearselection(e) + clearSelection(e) } override fun mousePressed(e: MouseEvent) { super.mousePressed(e) - clearselection(e) + clearSelection(e) } override fun mouseReleased(e: MouseEvent) { super.mouseReleased(e) - clearselection(e) + clearSelection(e) } - fun clearselection(e: MouseEvent) { + fun clearSelection(e: MouseEvent) { val index = list.locationToIndex(e.point) val bounds = list.getCellBounds(index, index) - if (bounds == null || !bounds.contains(e.point)) { - list.clearSelection() + if (bounds == null || !bounds.contains(e.point) || list.model.size <= 0) { + emtpySelection() + } else { + enableInputs() + } + } + }) + list.model.addListDataListener(object : ListDataListener { + override fun intervalAdded(e: ListDataEvent?) { + checkSize() + } + + override fun intervalRemoved(e: ListDataEvent?) { + checkSize() + } + + override fun contentsChanged(e: ListDataEvent?) { + checkSize() + } + + fun checkSize() { + if (list.model.size <= 0 || list.isSelectionEmpty) { + emtpySelection() } } }) + if (list.model.size <= 0) { + emtpySelection() + } + } + + private fun emtpySelection() { + list.clearSelection() + tip.text = Gui.createserverpack_gui_inclusions_editor_tip_default.toString() + source.isEditable = false + destination.isEditable = false + inclusionFilter.isEditable = false + exclusionFilter.isEditable = false + source.text = "" + destination.text = "" + inclusionFilter.text = "" + exclusionFilter.text = "" } /** @@ -266,36 +305,48 @@ class InclusionsEditor( fun updateIndex() { if (!list.valueIsAdjusting) { list.selectedIndex = 0 + enableInputs() } } + private fun enableInputs() { + source.isEditable = true + destination.isEditable = true + inclusionFilter.isEditable = true + exclusionFilter.isEditable = true + } + /** * @author Griefed */ fun sourceWasEdited() { - if (File(configEditor.getModpackDirectory(), source.text).exists() || File(source.text).exists()) { - list.selectedValue.source = source.text - timer.restart() - list.updateUI() - sourceInfo.info() - } else { - timer.stop() - sourceInfo.error(Gui.createserverpack_gui_inclusions_editor_source_error(source.text)) + if (list.model.size > 0 && !list.isSelectionEmpty) { + if (File(configEditor.getModpackDirectory(), source.text).exists() || File(source.text).exists()) { + list.selectedValue.source = source.text + timer.restart() + list.updateUI() + sourceInfo.info() + } else { + timer.stop() + sourceInfo.error(Gui.createserverpack_gui_inclusions_editor_source_error(source.text)) + } + configEditor.validateInputFields() } - configEditor.validateInputFields() } /** * @author Griefed */ fun destinationWasEdited() { - if (apiWrapper.stringUtilities.checkForInvalidPathCharacters(destination.text)) { - list.selectedValue.destination = destination.text - destinationInfo.info() - list.updateUI() - } else { - timer.stop() - destinationInfo.error(Gui.createserverpack_gui_inclusions_editor_destination_error(destination.text)) + if (list.model.size > 0 && !list.isSelectionEmpty) { + if (apiWrapper.stringUtilities.checkForInvalidPathCharacters(destination.text)) { + list.selectedValue.destination = destination.text + destinationInfo.info() + list.updateUI() + } else { + timer.stop() + destinationInfo.error(Gui.createserverpack_gui_inclusions_editor_destination_error(destination.text)) + } } } @@ -303,20 +354,22 @@ class InclusionsEditor( * @author Griefed */ fun inclusionFilterWasEdited() { - try { - inclusionFilter.text.toRegex() - list.selectedValue.inclusionFilter = inclusionFilter.text - timer.restart() - inclusionInfo.info() - list.updateUI() - } catch (ex: PatternSyntaxException) { - timer.stop() - var exception = ex.message ?: ex.description - exception = exception - .replace("\t", "%20") - .replace("\n", "
    ") - .replace(" ", " ") - inclusionInfo.error("${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}") + if (list.model.size > 0 && !list.isSelectionEmpty) { + try { + inclusionFilter.text.toRegex() + list.selectedValue.inclusionFilter = inclusionFilter.text + timer.restart() + inclusionInfo.info() + list.updateUI() + } catch (ex: PatternSyntaxException) { + timer.stop() + var exception = ex.message ?: ex.description + exception = exception + .replace("\t", "%20") + .replace("\n", "
    ") + .replace(" ", " ") + inclusionInfo.error("${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}") + } } } @@ -324,20 +377,22 @@ class InclusionsEditor( * @author Griefed */ fun exclusionFilterWasEdited() { - try { - exclusionFilter.text.toRegex() - list.selectedValue.exclusionFilter = exclusionFilter.text - timer.restart() - exclusionInfo.info() - list.updateUI() - } catch (ex: PatternSyntaxException) { - timer.stop() - var exception = ex.message ?: ex.description - exception = exception - .replace("\t", "    ") - .replace("\n", "
    ") - .replace(" ", " ") - exclusionInfo.error("${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}") + if (list.model.size > 0 && !list.isSelectionEmpty) { + try { + exclusionFilter.text.toRegex() + list.selectedValue.exclusionFilter = exclusionFilter.text + timer.restart() + exclusionInfo.info() + list.updateUI() + } catch (ex: PatternSyntaxException) { + timer.stop() + var exception = ex.message ?: ex.description + exception = exception + .replace("\t", "    ") + .replace("\n", "
    ") + .replace(" ", " ") + exclusionInfo.error("${Gui.createserverpack_gui_inclusions_editor_filter_error(exception)}") + } } } @@ -347,7 +402,10 @@ class InclusionsEditor( private fun selectionOccurred(event: ListSelectionEvent) { when { event.valueIsAdjusting -> return - list.selectedIndex == -1 -> return + list.selectedIndex == -1 || list.model.size <= 0 -> { + emtpySelection() + return + } } selectedInclusion = list.selectedValue source.text = selectedInclusion!!.source @@ -412,13 +470,23 @@ class InclusionsEditor( private fun addEntry(entry: InclusionSpecification) { inclusionModel.addElement(entry) list.selectedIndex = list.lastVisibleIndex + if (list.model.size == 1) { + list.selectedIndex = 0 + } } /** * @author Griefed */ private fun removeEntry(index: Int): InclusionSpecification { - return inclusionModel.remove(index) + val removed = inclusionModel.remove(index) + if (list.model.size == 1) { + list.selectedIndex = 0 + } + if (list.model.size <= 0) { + emtpySelection() + } + return removed } /** diff --git a/serverpackcreator-web/build.gradle.kts b/serverpackcreator-web/build.gradle.kts index be9cce855..29d6daed0 100644 --- a/serverpackcreator-web/build.gradle.kts +++ b/serverpackcreator-web/build.gradle.kts @@ -38,8 +38,8 @@ dependencies { api("org.springframework.boot:spring-boot-starter-artemis:2.7.10") api("com.github.gwenn:sqlite-dialect:0.1.2") api("org.xerial:sqlite-jdbc:3.41.2.1") - testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2") + testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3") testImplementation("org.springframework.boot:spring-boot-starter-test:2.7.10") developmentOnly("org.springframework.boot:spring-boot-devtools:2.7.10") }