mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-02 21:20:55 +00:00
Fix main classes and authors.
This commit is contained in:
parent
758ac2c7bc
commit
b653c179b7
@ -7,4 +7,5 @@ load: STARTUP
|
||||
depend:
|
||||
- Foundation
|
||||
authors:
|
||||
- kubelet
|
||||
- kubeliv
|
||||
- azenla
|
||||
|
@ -7,7 +7,8 @@ load: STARTUP
|
||||
depend:
|
||||
- Foundation
|
||||
authors:
|
||||
- kubelet
|
||||
- kubeliv
|
||||
- azenla
|
||||
commands:
|
||||
chaos:
|
||||
description: Chaos Toggle
|
||||
|
@ -5,7 +5,8 @@ api-version: 1.18
|
||||
prefix: Foundation
|
||||
load: STARTUP
|
||||
authors:
|
||||
- kubelet
|
||||
- kubeliv
|
||||
- azenla
|
||||
commands:
|
||||
fbackup:
|
||||
description: Back the server up now
|
||||
|
@ -4,4 +4,5 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
api(project(":common-heimdall"))
|
||||
compileOnly(project(":foundation-core"))
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import gay.pizza.foundation.heimdall.plugin.export.ExportChunksCommand
|
||||
import com.charleskorn.kaml.Yaml
|
||||
import com.zaxxer.hikari.HikariConfig
|
||||
import com.zaxxer.hikari.HikariDataSource
|
||||
import gay.pizza.foundation.core.Util
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.Listener
|
||||
@ -46,7 +47,7 @@ class HeimdallPlugin : JavaPlugin(), Listener {
|
||||
val pluginDataPath = dataFolder.toPath()
|
||||
pluginDataPath.toFile().mkdir()
|
||||
|
||||
val configPath = copyDefaultConfig<HeimdallPlugin>(
|
||||
val configPath = Util.copyDefaultConfig<HeimdallPlugin>(
|
||||
slF4JLogger,
|
||||
pluginDataPath,
|
||||
"heimdall.yaml"
|
||||
@ -169,33 +170,4 @@ class HeimdallPlugin : JavaPlugin(), Listener {
|
||||
}
|
||||
bufferFlushThread.flush()
|
||||
}
|
||||
|
||||
private inline fun <reified T> copyDefaultConfig(log: Logger, targetPath: Path, resourceName: String): Path {
|
||||
if (resourceName.startsWith("/")) {
|
||||
throw IllegalArgumentException("resourceName starts with slash")
|
||||
}
|
||||
|
||||
if (!targetPath.toFile().exists()) {
|
||||
throw Exception("Configuration output path does not exist!")
|
||||
}
|
||||
val outPath = targetPath.resolve(resourceName)
|
||||
val outFile = outPath.toFile()
|
||||
if (outFile.exists()) {
|
||||
log.debug("Configuration file already exists.")
|
||||
return outPath
|
||||
}
|
||||
|
||||
val resourceStream = T::class.java.getResourceAsStream("/$resourceName")
|
||||
?: throw Exception("Configuration resource does not exist!")
|
||||
val outputStream = outFile.outputStream()
|
||||
|
||||
resourceStream.use {
|
||||
outputStream.use {
|
||||
log.info("Copied default configuration to $outPath")
|
||||
resourceStream.copyTo(outputStream)
|
||||
}
|
||||
}
|
||||
|
||||
return outPath
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
name: Heimdall
|
||||
name: Foundation-Heimdall
|
||||
version: '${version}'
|
||||
main: io.kexec.heimdall.plugin.HeimdallPlugin
|
||||
main: gay.pizza.foundation.heimdall.plugin.HeimdallPlugin
|
||||
api-version: 1.18
|
||||
prefix: Heimdall
|
||||
prefix: Foundation-Heimdall
|
||||
load: STARTUP
|
||||
depend:
|
||||
- Foundation
|
||||
authors:
|
||||
- kendfinger
|
||||
- azenla
|
||||
commands:
|
||||
export_all_chunks:
|
||||
description: Export All Chunks
|
||||
|
@ -12,7 +12,7 @@ dependencies {
|
||||
|
||||
tasks.jar {
|
||||
manifest.attributes(
|
||||
"Main-Class" to "io.kexec.heimdall.tool.MainKt"
|
||||
"Main-Class" to "gay.pizza.foundation.heimdall.tool.MainKt"
|
||||
)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user