diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/requirements/BiomeRequirement.kt b/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/requirements/BiomeRequirement.kt index de8ea46a26..410bea2c4d 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/requirements/BiomeRequirement.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/pokemon/evolution/requirements/BiomeRequirement.kt @@ -25,11 +25,13 @@ import net.minecraft.world.biome.Biome * @since March 21st, 2022 */ class BiomeRequirement : EntityQueryRequirement { - val biomeCondition: RegistryLikeCondition = BiomeIdentifierCondition(Identifier("plains")) - override fun check(pokemon: Pokemon, queriedEntity: LivingEntity) = biomeCondition.fits( - queriedEntity.world.getBiome(queriedEntity.blockPos).value(), - queriedEntity.world.registryManager.get(RegistryKeys.BIOME) - ) + val biomeCondition: RegistryLikeCondition? = null + val biomeAnticondition: RegistryLikeCondition? = null + override fun check(pokemon: Pokemon, queriedEntity: LivingEntity): Boolean { + val biome = queriedEntity.world.getBiome(queriedEntity.blockPos).value() + val registry = queriedEntity.world.registryManager.get(RegistryKeys.BIOME) + return (biomeCondition == null || biomeCondition.fits(biome, registry)) && (biomeAnticondition == null || !biomeAnticondition.fits(biome, registry)) + } companion object { const val ADAPTER_VARIANT = "biome"