Compare commits

...

2 Commits

Author SHA1 Message Date
Auxilor
c9805e91b4 Updated to 6.20.1 2022-01-17 17:09:06 +00:00
Auxilor
e3be95ca4d Added soft faliures to config updating 2022-01-17 17:08:57 +00:00
3 changed files with 7 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ open class EcoUpdatableJSONConfig(
fun update() {
super.clearCache()
this.init(configFile)
val newConfig = configInJar
val newConfig = configInJar ?: return
if (newConfig.getKeys(true) == this.getKeys(true)) {
return
}
@@ -43,9 +43,9 @@ open class EcoUpdatableJSONConfig(
this.save()
}
private val configInJar: YamlConfiguration
private val configInJar: YamlConfiguration?
get() {
val newIn = this.source.getResourceAsStream(resourcePath) ?: throw NullPointerException("$name is null?")
val newIn = this.source.getResourceAsStream(resourcePath) ?: return null
val reader = BufferedReader(InputStreamReader(newIn, StandardCharsets.UTF_8))
val newConfig = YamlConfiguration()
newConfig.load(reader)

View File

@@ -20,7 +20,7 @@ class EcoUpdatableYamlConfig(
fun update() {
super.clearCache()
this.handle.load(configFile)
val newConfig = configInJar
val newConfig = configInJar ?: return
if (newConfig.getKeys(true) == this.handle.getKeys(true)) {
return
}
@@ -43,9 +43,9 @@ class EcoUpdatableYamlConfig(
this.handle.save(configFile)
}
private val configInJar: YamlConfiguration
private val configInJar: YamlConfiguration?
get() {
val newIn = source.getResourceAsStream(resourcePath) ?: throw NullPointerException("$name is null?")
val newIn = source.getResourceAsStream(resourcePath) ?: return null
val reader = BufferedReader(InputStreamReader(newIn, StandardCharsets.UTF_8))
val newConfig = YamlConfiguration()
newConfig.load(reader)

View File

@@ -1,3 +1,3 @@
version = 6.20.0
version = 6.20.1
plugin-name = eco
kotlin.code.style = official