forked from mirrors/cobblemon
Merge branch 'pokedex-firmware-update' into 'main'
Fix to 1.8 breaking older version dex data and failing to load it See merge request cable-mc/cobblemon!2244
This commit is contained in:
@@ -49,7 +49,12 @@ class FormDexRecord {
|
||||
it.genders.addAll(genders.map(Gender::valueOf))
|
||||
it.seenShinyStates.addAll(seenShinyStates)
|
||||
it.highestLevel = highestLevel
|
||||
it.knowledge = PokedexEntryProgress.valueOf(knowledge)
|
||||
it.knowledge = when (knowledge) { // The string checks are due to legacy enum names which got changes in 1.8
|
||||
"NONE" -> PokedexEntryProgress.UNREGISTERED
|
||||
"ENCOUNTERED" -> PokedexEntryProgress.SEEN
|
||||
"CAUGHT" -> PokedexEntryProgress.OWNED
|
||||
else -> PokedexEntryProgress.valueOf(knowledge)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,4 @@ enum class PokedexEntryProgress : StringRepresentable, Comparable<PokedexEntryPr
|
||||
OWNED;
|
||||
|
||||
override fun getSerializedName() = this.name
|
||||
companion object {
|
||||
val CODEC: Codec<PokedexEntryProgress> = RecordCodecBuilder.create { instance ->
|
||||
instance.map ({
|
||||
PokedexEntryProgress.valueOf(it)
|
||||
}, PrimitiveCodec.STRING.fieldOf("name").forGetter { it.name })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user