package fr.koka99cab.ibelievechickenfly.chickenfly;

import fr.koka99cab.ibelievechickenfly.IBelieveChickenFlyMod;
import java.util.Optional;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.animal.chicken.Chicken;
import net.minecraft.world.entity.animal.chicken.ChickenVariant;

public final class ModChickenVariants {
	public static final ResourceKey<ChickenVariant> BLUE = ResourceKey.create(Registries.CHICKEN_VARIANT, IBelieveChickenFlyMod.id("blue"));

	private ModChickenVariants() {
	}

	public static Optional<Holder.Reference<ChickenVariant>> getBlue(RegistryAccess registryAccess) {
		Registry<ChickenVariant> registry = registryAccess.lookupOrThrow(Registries.CHICKEN_VARIANT);
		return registry.get(BLUE);
	}

	public static boolean isBlue(Chicken chicken) {
		return chicken.getVariant().is(BLUE);
	}
}
