Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9805e91b4 | ||
|
|
e3be95ca4d |
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = 6.20.0
|
||||
version = 6.20.1
|
||||
plugin-name = eco
|
||||
kotlin.code.style = official
|
||||
Reference in New Issue
Block a user