227 lines
7.8 KiB
Rust
227 lines
7.8 KiB
Rust
/* 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 {
|
|
DamageBlockedByShield = 29i32,
|
|
InteractWithBeacon = 46i32,
|
|
FallOneCm = 10i32,
|
|
OpenChest = 59i32,
|
|
PlayTime = 1i32,
|
|
WalkOneCm = 6i32,
|
|
RaidWin = 72i32,
|
|
DamageDealtResisted = 27i32,
|
|
CleanArmor = 42i32,
|
|
SwimOneCm = 20i32,
|
|
HappyGhastOneCm = 17i32,
|
|
TalkedToVillager = 37i32,
|
|
EnchantItem = 55i32,
|
|
Drop = 24i32,
|
|
PotFlower = 52i32,
|
|
OpenShulkerBox = 61i32,
|
|
WalkOnWaterOneCm = 9i32,
|
|
InteractWithCampfire = 66i32,
|
|
InteractWithFurnace = 57i32,
|
|
InteractWithLectern = 65i32,
|
|
RaidTrigger = 71i32,
|
|
StriderOneCm = 21i32,
|
|
CrouchOneCm = 7i32,
|
|
EatCakeSlice = 39i32,
|
|
PlayRecord = 56i32,
|
|
InteractWithCraftingTable = 58i32,
|
|
SneakTime = 5i32,
|
|
BoatOneCm = 15i32,
|
|
DamageResisted = 31i32,
|
|
Deaths = 32i32,
|
|
TotalWorldTime = 2i32,
|
|
PigOneCm = 16i32,
|
|
AviateOneCm = 19i32,
|
|
Jump = 23i32,
|
|
AnimalsBred = 34i32,
|
|
InspectHopper = 48i32,
|
|
InteractWithBlastFurnace = 63i32,
|
|
SprintOneCm = 8i32,
|
|
DamageTaken = 28i32,
|
|
MobKills = 33i32,
|
|
InteractWithCartographyTable = 67i32,
|
|
TimeSinceDeath = 3i32,
|
|
MinecartOneCm = 14i32,
|
|
InteractWithGrindstone = 74i32,
|
|
PlayNoteblock = 50i32,
|
|
OpenBarrel = 62i32,
|
|
NautilusOneCm = 22i32,
|
|
CleanShulkerBox = 44i32,
|
|
FlyOneCm = 12i32,
|
|
PlayerKills = 35i32,
|
|
InspectDropper = 47i32,
|
|
InteractWithLoom = 68i32,
|
|
DamageDealt = 25i32,
|
|
InspectDispenser = 49i32,
|
|
UseCauldron = 41i32,
|
|
TimeSinceRest = 4i32,
|
|
InteractWithBrewingstand = 45i32,
|
|
InteractWithAnvil = 73i32,
|
|
TuneNoteblock = 51i32,
|
|
BellRing = 70i32,
|
|
FillCauldron = 40i32,
|
|
FishCaught = 36i32,
|
|
ClimbOneCm = 11i32,
|
|
InteractWithSmithingTable = 76i32,
|
|
TriggerTrappedChest = 53i32,
|
|
InteractWithSmoker = 64i32,
|
|
OpenEnderchest = 54i32,
|
|
CleanBanner = 43i32,
|
|
LeaveGame = 0i32,
|
|
SleepInBed = 60i32,
|
|
DamageDealtAbsorbed = 26i32,
|
|
WalkUnderWaterOneCm = 13i32,
|
|
TradedWithVillager = 38i32,
|
|
InteractWithStonecutter = 69i32,
|
|
HorseOneCm = 18i32,
|
|
DamageAbsorbed = 30i32,
|
|
TargetHit = 75i32,
|
|
}
|
|
impl CustomStatistic {
|
|
#[must_use]
|
|
pub const fn from_i32(id: i32) -> Option<Self> {
|
|
match id {
|
|
29i32 => Some(Self::DamageBlockedByShield),
|
|
46i32 => Some(Self::InteractWithBeacon),
|
|
10i32 => Some(Self::FallOneCm),
|
|
59i32 => Some(Self::OpenChest),
|
|
1i32 => Some(Self::PlayTime),
|
|
6i32 => Some(Self::WalkOneCm),
|
|
72i32 => Some(Self::RaidWin),
|
|
27i32 => Some(Self::DamageDealtResisted),
|
|
42i32 => Some(Self::CleanArmor),
|
|
20i32 => Some(Self::SwimOneCm),
|
|
17i32 => Some(Self::HappyGhastOneCm),
|
|
37i32 => Some(Self::TalkedToVillager),
|
|
55i32 => Some(Self::EnchantItem),
|
|
24i32 => Some(Self::Drop),
|
|
52i32 => Some(Self::PotFlower),
|
|
61i32 => Some(Self::OpenShulkerBox),
|
|
9i32 => Some(Self::WalkOnWaterOneCm),
|
|
66i32 => Some(Self::InteractWithCampfire),
|
|
57i32 => Some(Self::InteractWithFurnace),
|
|
65i32 => Some(Self::InteractWithLectern),
|
|
71i32 => Some(Self::RaidTrigger),
|
|
21i32 => Some(Self::StriderOneCm),
|
|
7i32 => Some(Self::CrouchOneCm),
|
|
39i32 => Some(Self::EatCakeSlice),
|
|
56i32 => Some(Self::PlayRecord),
|
|
58i32 => Some(Self::InteractWithCraftingTable),
|
|
5i32 => Some(Self::SneakTime),
|
|
15i32 => Some(Self::BoatOneCm),
|
|
31i32 => Some(Self::DamageResisted),
|
|
32i32 => Some(Self::Deaths),
|
|
2i32 => Some(Self::TotalWorldTime),
|
|
16i32 => Some(Self::PigOneCm),
|
|
19i32 => Some(Self::AviateOneCm),
|
|
23i32 => Some(Self::Jump),
|
|
34i32 => Some(Self::AnimalsBred),
|
|
48i32 => Some(Self::InspectHopper),
|
|
63i32 => Some(Self::InteractWithBlastFurnace),
|
|
8i32 => Some(Self::SprintOneCm),
|
|
28i32 => Some(Self::DamageTaken),
|
|
33i32 => Some(Self::MobKills),
|
|
67i32 => Some(Self::InteractWithCartographyTable),
|
|
3i32 => Some(Self::TimeSinceDeath),
|
|
14i32 => Some(Self::MinecartOneCm),
|
|
74i32 => Some(Self::InteractWithGrindstone),
|
|
50i32 => Some(Self::PlayNoteblock),
|
|
62i32 => Some(Self::OpenBarrel),
|
|
22i32 => Some(Self::NautilusOneCm),
|
|
44i32 => Some(Self::CleanShulkerBox),
|
|
12i32 => Some(Self::FlyOneCm),
|
|
35i32 => Some(Self::PlayerKills),
|
|
47i32 => Some(Self::InspectDropper),
|
|
68i32 => Some(Self::InteractWithLoom),
|
|
25i32 => Some(Self::DamageDealt),
|
|
49i32 => Some(Self::InspectDispenser),
|
|
41i32 => Some(Self::UseCauldron),
|
|
4i32 => Some(Self::TimeSinceRest),
|
|
45i32 => Some(Self::InteractWithBrewingstand),
|
|
73i32 => Some(Self::InteractWithAnvil),
|
|
51i32 => Some(Self::TuneNoteblock),
|
|
70i32 => Some(Self::BellRing),
|
|
40i32 => Some(Self::FillCauldron),
|
|
36i32 => Some(Self::FishCaught),
|
|
11i32 => Some(Self::ClimbOneCm),
|
|
76i32 => Some(Self::InteractWithSmithingTable),
|
|
53i32 => Some(Self::TriggerTrappedChest),
|
|
64i32 => Some(Self::InteractWithSmoker),
|
|
54i32 => Some(Self::OpenEnderchest),
|
|
43i32 => Some(Self::CleanBanner),
|
|
0i32 => Some(Self::LeaveGame),
|
|
60i32 => Some(Self::SleepInBed),
|
|
26i32 => Some(Self::DamageDealtAbsorbed),
|
|
13i32 => Some(Self::WalkUnderWaterOneCm),
|
|
38i32 => Some(Self::TradedWithVillager),
|
|
69i32 => Some(Self::InteractWithStonecutter),
|
|
18i32 => Some(Self::HorseOneCm),
|
|
30i32 => Some(Self::DamageAbsorbed),
|
|
75i32 => Some(Self::TargetHit),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
impl TryFrom<i32> for CustomStatistic {
|
|
type Error = ();
|
|
fn try_from(value: i32) -> Result<Self, Self::Error> {
|
|
Self::from_i32(value).ok_or(())
|
|
}
|
|
}
|