mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-11-17 23:41:55 +01:00
small cleanup
This commit is contained in:
parent
9aea30e441
commit
b427ff532b
1 changed files with 8 additions and 10 deletions
|
@ -6,16 +6,14 @@ import java.io.File
|
|||
import java.io.FileReader
|
||||
|
||||
class ModpackJsonHandler(val modpackJsonFile: File) {
|
||||
var asWrapper: ASWrapper? = null
|
||||
private set
|
||||
get() = field ?: run {
|
||||
if(modpackJsonFile.exists()) {
|
||||
val reader = FileReader(modpackJsonFile)
|
||||
field = ASWrapper(AddonscriptJSON.read(reader, AddonscriptJSON::class.java))
|
||||
reader.close()
|
||||
}
|
||||
field
|
||||
}
|
||||
val asWrapper: ASWrapper? by lazy {
|
||||
if(modpackJsonFile.exists()) {
|
||||
val reader = FileReader(modpackJsonFile)
|
||||
val ret = ASWrapper(AddonscriptJSON.read(reader, AddonscriptJSON::class.java))
|
||||
reader.close()
|
||||
ret
|
||||
} else null
|
||||
}
|
||||
|
||||
val json: AddonscriptJSON?
|
||||
get() = asWrapper?.json
|
||||
|
|
Loading…
Reference in a new issue