Skip to content

Commit 0a1cdfc

Browse files
committed
✨ Feat: Update to Paper 1.20.6 and improve resource handling.
- Update project version to 1.20.6-SNAPSHOT - Update Paper API dependency to 1.20.6-R0.1-SNAPSHOT - Add task to copy binary resources - Improve plugin directory checking and resource loading - Update database setting path initialization
1 parent 9c5a113 commit 0a1cdfc

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

build.gradle.kts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ subprojects {
1616
}
1717

1818
group = "fun.fifu.powered"
19-
version = "1.21-SNAPSHOT"
19+
version = "1.20.6-SNAPSHOT"
2020
val api_version = "1.19"
2121

2222
repositories {
@@ -33,7 +33,7 @@ subprojects {
3333
implementation(fileTree("./lib"))
3434
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_version")
3535
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit_version")
36-
compileOnly("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT")
36+
compileOnly("io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT")
3737
compileOnly("org.projectlombok:lombok:$lombok_version")
3838
}
3939

@@ -42,7 +42,14 @@ subprojects {
4242
}
4343

4444
tasks {
45+
register<Copy>("copyBinaryResources") {
46+
from("src/main/resources") {
47+
include("*.db")
48+
}
49+
into("build/resources/main")
50+
}
4551
processResources {
52+
dependsOn("copyBinaryResources")
4653
exclude("*.db")
4754
expand(
4855
"version" to project.version,

fifu-sky/src/main/kotlin/fun/fifu/fifusky/FiFuSky.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class FiFuSky : JavaPlugin() {
3636
*/
3737
override fun onLoad() {
3838
fs = this
39-
if (!File("plugins/FiFuSky").isDirectory) {
39+
val pluginDir = File("plugins/FiFuSky")
40+
if (!pluginDir.exists() || !pluginDir.isDirectory) {
4041
saveResource("FiFuSky.db", false)
4142
saveResource("db.setting", false)
4243
}

fifu-sky/src/main/kotlin/fun/fifu/fifusky/data/SQLiteer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object SQLiteer {
3232
private const val SkyIsland = "SkyIsland"
3333

3434
init {
35-
DbUtil.setDbSettingPathGlobal(File(File(javaClass.protectionDomain.codeSource.location.path).absoluteFile.parentFile.path+"/FiFuSky/db.setting").absoluteFile.path)
35+
DbUtil.setDbSettingPathGlobal(File("plugins/FiFuSky/db.setting").absolutePath)
3636
}
3737

3838

0 commit comments

Comments
 (0)