diff --git a/build.gradle.kts b/build.gradle.kts index 0966205..43086c2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,6 +12,7 @@ subprojects { repositories { mavenCentral() maven("https://repo.mineinabyss.com/releases") + maven("https://repo.mineinabyss.com/snapshots") maven("https://erethon.de/repo/") maven("https://repo.papermc.io/repository/maven-public/") maven("https://repo.spaceio.xyz/repository/maven-snapshots/") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 963229c..26c6286 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -41,7 +41,7 @@ customblockdata="2.2.2" morepersistentdatatypes="2.4.0" [libraries] -creative-api = { module = "team.unnamed:creative-api", version.ref = "creative" } +creative-api = { module = "team.unnamed:creative-api", version = "1.7.4-SNAPSHOT" } creative-serializer-minecraft = { module = "team.unnamed:creative-serializer-minecraft", version.ref = "creative" } creative-server = { module = "team.unnamed:creative-server", version.ref = "creative" } exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" } diff --git a/idofront-config/src/main/kotlin/com/mineinabyss/idofront/config/Config.kt b/idofront-config/src/main/kotlin/com/mineinabyss/idofront/config/Config.kt index de52d3f..c065ecc 100644 --- a/idofront-config/src/main/kotlin/com/mineinabyss/idofront/config/Config.kt +++ b/idofront-config/src/main/kotlin/com/mineinabyss/idofront/config/Config.kt @@ -38,7 +38,7 @@ class Config( fun getOrLoad(): T { loaded?.let { return it } - return runCatching(::load).onFailure { it.printStackTrace() }.getOrDefault(default).also(onFirstLoad).also(onLoad) + return runCatching(::load).onFailure { it.printStackTrace() }.getOrDefault(loaded ?: default).also(onFirstLoad).also(onLoad) } fun reload(): T { diff --git a/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/MinecraftAssetExtractor.kt b/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/MinecraftAssetExtractor.kt index d6ae120..893f706 100644 --- a/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/MinecraftAssetExtractor.kt +++ b/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/MinecraftAssetExtractor.kt @@ -18,6 +18,7 @@ object MinecraftAssetExtractor { val assetPath = Bukkit.getPluginsFolder().resolve("Idofront/assetCache/${Bukkit.getMinecraftVersion()}") fun extractLatest() { + if (assetPath.exists() && !assetPath.listFiles().isNullOrEmpty()) return idofrontLogger.i("Extracting latest vanilla-assets...") val versionInfo = runCatching { downloadJson(findVersionInfoUrl() ?: return)?.asJsonObject diff --git a/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/ResourcePacks.kt b/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/ResourcePacks.kt index b148dee..56a05dc 100644 --- a/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/ResourcePacks.kt +++ b/idofront-util/src/main/kotlin/com/mineinabyss/idofront/resourcepacks/ResourcePacks.kt @@ -20,7 +20,7 @@ object ResourcePacks { * The ResourcePack instance does not contain any of the vanilla OGG files due to filesize optimizations */ val defaultVanillaResourcePack by lazy { - MinecraftAssetExtractor.assetPath.apply { if (!exists()) MinecraftAssetExtractor.extractLatest() }.let(::readToResourcePack) + MinecraftAssetExtractor.assetPath.apply { MinecraftAssetExtractor.extractLatest() }.let(::readToResourcePack) } /** @@ -50,7 +50,7 @@ object ResourcePacks { file.extension == "zip" -> resourcePackReader.readFromZipFile(file) else -> null } - }.onFailure { idofrontLogger.w(file.name + ": " + it.message) }.getOrNull() + }.onFailure { it.printStackTrace()/*idofrontLogger.w(file.name + ": " + it.message)*/ }.getOrNull() } fun writeToFile(file: File, resourcePack: ResourcePack) {