mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
small changes
This commit is contained in:
parent
ee5c31ad40
commit
e25723d921
1 changed files with 11 additions and 5 deletions
|
|
@ -20,13 +20,13 @@ object DataPackDependency {
|
||||||
private val START_DETECT_VERSION = Version(1, 19, 0)
|
private val START_DETECT_VERSION = Version(1, 19, 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of the latest CA update related to the pack
|
* Map of the latest CustomAnvil update related to the pack
|
||||||
*/
|
*/
|
||||||
private val LASTEST_VERSION = mapOf(
|
private val LASTEST_VERSION = mapOf(
|
||||||
Pair("bracken", Version(1, 11, 0))
|
Pair("bracken", Version(1, 11, 0))
|
||||||
)
|
)
|
||||||
|
|
||||||
val enabledDatapack: List<String>
|
val enabledDatapacks: List<String>
|
||||||
get() {
|
get() {
|
||||||
val version: Version = UpdateUtils.currentMinecraftVersion()
|
val version: Version = UpdateUtils.currentMinecraftVersion()
|
||||||
if (version.lesserThan(START_DETECT_VERSION)) return emptyList()
|
if (version.lesserThan(START_DETECT_VERSION)) return emptyList()
|
||||||
|
|
@ -35,7 +35,7 @@ object DataPackDependency {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleDatapackConfigs() {
|
fun handleDatapackConfigs() {
|
||||||
val enabledDatapack = enabledDatapack
|
val enabledDatapack = enabledDatapacks
|
||||||
for (packName in enabledDatapack) {
|
for (packName in enabledDatapack) {
|
||||||
// Handling of pack name is horrible: it is based on file name
|
// Handling of pack name is horrible: it is based on file name
|
||||||
// So if someone rename a datapack it will make me sad
|
// So if someone rename a datapack it will make me sad
|
||||||
|
|
@ -44,14 +44,20 @@ object DataPackDependency {
|
||||||
if (packName.contains("bp_post_scarcity", ignoreCase = true)
|
if (packName.contains("bp_post_scarcity", ignoreCase = true)
|
||||||
|| packName.contains("bracken", ignoreCase = true)) {
|
|| packName.contains("bracken", ignoreCase = true)) {
|
||||||
handlePack("bracken")
|
handlePack("bracken")
|
||||||
writeDefaultByNamespace("bracken")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handlePack(pack: String) {
|
private fun handlePack(pack: String){
|
||||||
|
CustomAnvil.instance.logger.info("handling datapack $pack")
|
||||||
|
handlePackInitialConfig(pack)
|
||||||
|
writeDefaultByNamespace(pack)
|
||||||
|
CustomAnvil.instance.logger.info("configuration done for $pack")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handlePackInitialConfig(pack: String) {
|
||||||
val defConfig = ConfigHolder.DEFAULT_CONFIG
|
val defConfig = ConfigHolder.DEFAULT_CONFIG
|
||||||
val version = LASTEST_VERSION[pack]
|
val version = LASTEST_VERSION[pack]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue