Change Species#create() to use the species identifier.

Uses the identifier for the species in the name when using Species#create to avoid discrepancies between the name and identifier causing issues. (Like in the case of Type: Null, Farfetch'd, Ho-oh, and many others.)

Fixes https://gitlab.com/cable-mc/cobblemon/-/issues/1740 - thanks for finding this one!
This commit is contained in:
Neovitalism committed 2025-11-14 00:49:31 -06:00
1 parent ca91d42ddf
commit e2fdf3cffc
1 file changed
+1 -1
@@ -203,7 +203,7 @@ class Species : ClientDataSynchronizer<Species>, ShowdownIdentifiable {
this.forms.forEach(FormData::resolveEvolutionMoves)
}
fun create(level: Int = 10) = PokemonProperties.parse("species=\"${this.name}\" level=${level}").create()
fun create(level: Int = 10) = PokemonProperties.parse("species=\"${this.resourceIdentifier}\" level=${level}").create()
fun getForm(aspects: Set<String>) = forms.lastOrNull { it.aspects.all { it in aspects } } ?: standardForm
fun getFormByName(name: String) = forms.firstOrNull { it.name == name } ?: standardForm