Copy macros directly in Configuration.kt

This commit is contained in:
Username404 2021-05-20 15:24:06 +02:00
parent c7729af67f
commit 3008165c22
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -75,8 +75,8 @@ object Configuration {
val macros: MutableSet<Macro> = run { val macros: MutableSet<Macro> = run {
if (!macroFile.exists()) macroFile.createNewFile() if (!macroFile.exists()) macroFile.createNewFile()
macroFile.readLines(Charset.forName("UTF-8")).map { macroFile.readLines(Charset.forName("UTF-8")).map {
Snowy.Gson.fromJson(it, Macro::class.java) Snowy.Gson.fromJson(it, Macro::class.java).copy()
}.map { it.copy() }.toMutableSet() }.toMutableSet()
} }
init { init {
Runtime.getRuntime().addShutdownHook( Runtime.getRuntime().addShutdownHook(