Add asset path stack push/pop when loading globals

This commit is contained in:
DBotThePony 2023-09-29 22:47:44 +07:00
parent 087c4616b6
commit e96d668f26
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -3,6 +3,7 @@ package ru.dbotthepony.kstarbound
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.kstarbound.defs.MovementParameters
import ru.dbotthepony.kstarbound.defs.player.PlayerMovementParameters
import ru.dbotthepony.kstarbound.util.AssetPathStack
import java.util.concurrent.ForkJoinPool
import java.util.concurrent.ForkJoinTask
import kotlin.reflect.KMutableProperty0
@ -40,7 +41,9 @@ object GlobalDefaults {
return EmptyTask
} else {
return executor.submit {
accept.set(Starbound.gson.fromJson(file.jsonReader(), T::class.java))
AssetPathStack("/") {
accept.set(Starbound.gson.fromJson(file.jsonReader(), T::class.java))
}
}
}
}