/* This file is generated. Do not edit manually. */
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(i32)]
pub enum StatisticCategory {
    Mined = 0i32,
    Crafted = 1i32,
    Used = 2i32,
    Broken = 3i32,
    PickedUp = 4i32,
    Dropped = 5i32,
    Killed = 6i32,
    KilledBy = 7i32,
    Custom = 8i32,
}
impl StatisticCategory {
    #[must_use]
    pub const fn from_i32(id: i32) -> Option<Self> {
        match id {
            0i32 => Some(Self::Mined),
            1i32 => Some(Self::Crafted),
            2i32 => Some(Self::Used),
            3i32 => Some(Self::Broken),
            4i32 => Some(Self::PickedUp),
            5i32 => Some(Self::Dropped),
            6i32 => Some(Self::Killed),
            7i32 => Some(Self::KilledBy),
            8i32 => Some(Self::Custom),
            _ => None,
        }
    }
    #[must_use]
    pub fn from_registry_key(name: &str) -> Option<Self> {
        let name = name.strip_prefix("minecraft:").unwrap_or(name);
        match name {
            "mined" => Some(Self::Mined),
            "crafted" => Some(Self::Crafted),
            "used" => Some(Self::Used),
            "broken" => Some(Self::Broken),
            "picked_up" => Some(Self::PickedUp),
            "dropped" => Some(Self::Dropped),
            "killed" => Some(Self::Killed),
            "killed_by" => Some(Self::KilledBy),
            "custom" => Some(Self::Custom),
            _ => None,
        }
    }
}
impl TryFrom<i32> for StatisticCategory {
    type Error = ();
    fn try_from(value: i32) -> Result<Self, Self::Error> {
        Self::from_i32(value).ok_or(())
    }
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(i32)]
pub enum CustomStatistic {
    AviateOneCm = 19i32,
    DamageDealt = 25i32,
    CleanBanner = 43i32,
    InspectDispenser = 49i32,
    PotFlower = 52i32,
    TradedWithVillager = 38i32,
    PlayNoteblock = 50i32,
    WalkOnWaterOneCm = 9i32,
    OpenShulkerBox = 61i32,
    DamageResisted = 31i32,
    InteractWithLectern = 65i32,
    BellRing = 70i32,
    UseCauldron = 41i32,
    InteractWithAnvil = 73i32,
    FallOneCm = 10i32,
    PigOneCm = 16i32,
    EnchantItem = 55i32,
    SleepInBed = 60i32,
    FlyOneCm = 12i32,
    RaidTrigger = 71i32,
    DamageDealtResisted = 27i32,
    InteractWithBrewingstand = 45i32,
    InspectHopper = 48i32,
    PlayRecord = 56i32,
    WalkOneCm = 6i32,
    CleanArmor = 42i32,
    InteractWithCartographyTable = 67i32,
    OpenEnderchest = 54i32,
    InteractWithFurnace = 57i32,
    SwimOneCm = 20i32,
    DamageAbsorbed = 30i32,
    OpenBarrel = 62i32,
    TimeSinceRest = 4i32,
    DamageBlockedByShield = 29i32,
    NautilusOneCm = 22i32,
    TimeSinceDeath = 3i32,
    InteractWithBlastFurnace = 63i32,
    ClimbOneCm = 11i32,
    HappyGhastOneCm = 17i32,
    TotalWorldTime = 2i32,
    Deaths = 32i32,
    InteractWithBeacon = 46i32,
    PlayTime = 1i32,
    InteractWithCraftingTable = 58i32,
    MinecartOneCm = 14i32,
    TalkedToVillager = 37i32,
    PlayerKills = 35i32,
    InteractWithStonecutter = 69i32,
    InteractWithSmithingTable = 76i32,
    Jump = 23i32,
    FillCauldron = 40i32,
    RaidWin = 72i32,
    TriggerTrappedChest = 53i32,
    BoatOneCm = 15i32,
    DamageDealtAbsorbed = 26i32,
    CleanShulkerBox = 44i32,
    TuneNoteblock = 51i32,
    InteractWithCampfire = 66i32,
    SprintOneCm = 8i32,
    InteractWithLoom = 68i32,
    FishCaught = 36i32,
    InteractWithGrindstone = 74i32,
    DamageTaken = 28i32,
    InspectDropper = 47i32,
    AnimalsBred = 34i32,
    WalkUnderWaterOneCm = 13i32,
    HorseOneCm = 18i32,
    OpenChest = 59i32,
    MobKills = 33i32,
    SneakTime = 5i32,
    EatCakeSlice = 39i32,
    CrouchOneCm = 7i32,
    InteractWithSmoker = 64i32,
    TargetHit = 75i32,
    StriderOneCm = 21i32,
    LeaveGame = 0i32,
    Drop = 24i32,
}
impl CustomStatistic {
    #[must_use]
    pub const fn from_i32(id: i32) -> Option<Self> {
        match id {
            19i32 => Some(Self::AviateOneCm),
            25i32 => Some(Self::DamageDealt),
            43i32 => Some(Self::CleanBanner),
            49i32 => Some(Self::InspectDispenser),
            52i32 => Some(Self::PotFlower),
            38i32 => Some(Self::TradedWithVillager),
            50i32 => Some(Self::PlayNoteblock),
            9i32 => Some(Self::WalkOnWaterOneCm),
            61i32 => Some(Self::OpenShulkerBox),
            31i32 => Some(Self::DamageResisted),
            65i32 => Some(Self::InteractWithLectern),
            70i32 => Some(Self::BellRing),
            41i32 => Some(Self::UseCauldron),
            73i32 => Some(Self::InteractWithAnvil),
            10i32 => Some(Self::FallOneCm),
            16i32 => Some(Self::PigOneCm),
            55i32 => Some(Self::EnchantItem),
            60i32 => Some(Self::SleepInBed),
            12i32 => Some(Self::FlyOneCm),
            71i32 => Some(Self::RaidTrigger),
            27i32 => Some(Self::DamageDealtResisted),
            45i32 => Some(Self::InteractWithBrewingstand),
            48i32 => Some(Self::InspectHopper),
            56i32 => Some(Self::PlayRecord),
            6i32 => Some(Self::WalkOneCm),
            42i32 => Some(Self::CleanArmor),
            67i32 => Some(Self::InteractWithCartographyTable),
            54i32 => Some(Self::OpenEnderchest),
            57i32 => Some(Self::InteractWithFurnace),
            20i32 => Some(Self::SwimOneCm),
            30i32 => Some(Self::DamageAbsorbed),
            62i32 => Some(Self::OpenBarrel),
            4i32 => Some(Self::TimeSinceRest),
            29i32 => Some(Self::DamageBlockedByShield),
            22i32 => Some(Self::NautilusOneCm),
            3i32 => Some(Self::TimeSinceDeath),
            63i32 => Some(Self::InteractWithBlastFurnace),
            11i32 => Some(Self::ClimbOneCm),
            17i32 => Some(Self::HappyGhastOneCm),
            2i32 => Some(Self::TotalWorldTime),
            32i32 => Some(Self::Deaths),
            46i32 => Some(Self::InteractWithBeacon),
            1i32 => Some(Self::PlayTime),
            58i32 => Some(Self::InteractWithCraftingTable),
            14i32 => Some(Self::MinecartOneCm),
            37i32 => Some(Self::TalkedToVillager),
            35i32 => Some(Self::PlayerKills),
            69i32 => Some(Self::InteractWithStonecutter),
            76i32 => Some(Self::InteractWithSmithingTable),
            23i32 => Some(Self::Jump),
            40i32 => Some(Self::FillCauldron),
            72i32 => Some(Self::RaidWin),
            53i32 => Some(Self::TriggerTrappedChest),
            15i32 => Some(Self::BoatOneCm),
            26i32 => Some(Self::DamageDealtAbsorbed),
            44i32 => Some(Self::CleanShulkerBox),
            51i32 => Some(Self::TuneNoteblock),
            66i32 => Some(Self::InteractWithCampfire),
            8i32 => Some(Self::SprintOneCm),
            68i32 => Some(Self::InteractWithLoom),
            36i32 => Some(Self::FishCaught),
            74i32 => Some(Self::InteractWithGrindstone),
            28i32 => Some(Self::DamageTaken),
            47i32 => Some(Self::InspectDropper),
            34i32 => Some(Self::AnimalsBred),
            13i32 => Some(Self::WalkUnderWaterOneCm),
            18i32 => Some(Self::HorseOneCm),
            59i32 => Some(Self::OpenChest),
            33i32 => Some(Self::MobKills),
            5i32 => Some(Self::SneakTime),
            39i32 => Some(Self::EatCakeSlice),
            7i32 => Some(Self::CrouchOneCm),
            64i32 => Some(Self::InteractWithSmoker),
            75i32 => Some(Self::TargetHit),
            21i32 => Some(Self::StriderOneCm),
            0i32 => Some(Self::LeaveGame),
            24i32 => Some(Self::Drop),
            _ => None,
        }
    }
}
impl TryFrom<i32> for CustomStatistic {
    type Error = ();
    fn try_from(value: i32) -> Result<Self, Self::Error> {
        Self::from_i32(value).ok_or(())
    }
}
