mirror of
https://github.com/GayPizzaSpecifications/concrete.git
synced 2025-08-04 13:41:33 +00:00
Mixed project sample and more bug fixes.
This commit is contained in:
@ -6,4 +6,5 @@ interface ConcreteExtension {
|
||||
val paperVersionGroup: Property<String>
|
||||
val paperApiVersion: Property<String>
|
||||
val minecraftServerPath: Property<String>
|
||||
val acceptServerEula: Property<Boolean>
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import org.gradle.api.tasks.options.Option
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import java.util.Properties
|
||||
|
||||
open class SetupPaperServer : DefaultTask() {
|
||||
init {
|
||||
@ -39,17 +40,21 @@ open class SetupPaperServer : DefaultTask() {
|
||||
paperPluginsDirectory.mkdirs()
|
||||
}
|
||||
|
||||
for (project in project.allprojects) {
|
||||
if (!project.isPluginProject()) {
|
||||
continue
|
||||
}
|
||||
|
||||
for (project in project.findPluginProjects()) {
|
||||
val task = project.shadowJarTask!!
|
||||
val pluginJarFile = task.outputs.files.first()
|
||||
val pluginLinkFile = paperPluginsDirectory.resolve("${project.name}.jar")
|
||||
pluginLinkFile.delete()
|
||||
Files.createSymbolicLink(pluginLinkFile.toPath(), pluginJarFile.toPath())
|
||||
}
|
||||
|
||||
if (concrete.acceptServerEula.isPresent && concrete.acceptServerEula.get()) {
|
||||
val writer = minecraftServerDirectory.resolve("eula.txt").bufferedWriter()
|
||||
val properties = Properties()
|
||||
properties.setProperty("eula", "true")
|
||||
properties.store(writer, "Written by Concrete")
|
||||
writer.close()
|
||||
}
|
||||
}
|
||||
|
||||
private fun downloadLatestBuild(paperVersionGroup: String, paperJarFile: File) {
|
||||
|
@ -14,9 +14,9 @@ class SmartDownloader(
|
||||
val hashResult = checkLocalFileHash()
|
||||
if (hashResult != HashResult.ValidHash) {
|
||||
downloadRemoteFile()
|
||||
return false
|
||||
return true
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
private fun downloadRemoteFile() {
|
||||
|
Reference in New Issue
Block a user