diff options
Diffstat (limited to 'src/main/kotlin/util/data/ProfileSpecificDataHolder.kt')
-rw-r--r-- | src/main/kotlin/util/data/ProfileSpecificDataHolder.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/util/data/ProfileSpecificDataHolder.kt b/src/main/kotlin/util/data/ProfileSpecificDataHolder.kt index 1cd4f22..2566e4c 100644 --- a/src/main/kotlin/util/data/ProfileSpecificDataHolder.kt +++ b/src/main/kotlin/util/data/ProfileSpecificDataHolder.kt @@ -22,10 +22,10 @@ abstract class ProfileSpecificDataHolder<S>( private val configDefault: () -> S ) : IDataHolder<S?> { - var allConfigs: MutableMap<UUID, S> + var allConfigs: MutableMap<String, S> override val data: S? - get() = SBData.profileId?.let { + get() = SBData.genericProfileId?.let { allConfigs.computeIfAbsent(it) { configDefault() } } @@ -36,7 +36,7 @@ abstract class ProfileSpecificDataHolder<S>( private val configDirectory: Path get() = Firmament.CONFIG_DIR.resolve("profiles").resolve(configName) - private fun readValues(): MutableMap<UUID, S> { + private fun readValues(): MutableMap<String, S> { if (!configDirectory.exists()) { configDirectory.createDirectories() } @@ -45,7 +45,7 @@ abstract class ProfileSpecificDataHolder<S>( .filter { it.extension == "json" } .mapNotNull { try { - UUID.fromString(it.nameWithoutExtension) to Firmament.json.decodeFromString(dataSerializer, it.readText()) + (it.nameWithoutExtension) to Firmament.json.decodeFromString(dataSerializer, it.readText()) } catch (e: Exception) { /* Expecting IOException and SerializationException, but Kotlin doesn't allow multi catches*/ IDataHolder.badLoads.add(configName) Firmament.logger.error( |