feat(plugin): add more block entity api stuff

This commit is contained in:
Alexander Medvedev
2026-08-14 11:32:50 +02:00
parent 00cb2f9240
commit e09e8c529a
21 changed files with 3703 additions and 165 deletions

View File

@@ -0,0 +1,214 @@
/* This file is generated. Do not edit manually. */
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub enum DyeColor {
White,
Orange,
Magenta,
LightBlue,
Yellow,
Lime,
Pink,
Gray,
LightGray,
Cyan,
Purple,
Blue,
Brown,
Green,
Red,
#[default]
Black,
}
impl DyeColor {
#[must_use]
pub const fn id(&self) -> u8 {
match self {
Self::White => 0u8,
Self::Orange => 1u8,
Self::Magenta => 2u8,
Self::LightBlue => 3u8,
Self::Yellow => 4u8,
Self::Lime => 5u8,
Self::Pink => 6u8,
Self::Gray => 7u8,
Self::LightGray => 8u8,
Self::Cyan => 9u8,
Self::Purple => 10u8,
Self::Blue => 11u8,
Self::Brown => 12u8,
Self::Green => 13u8,
Self::Red => 14u8,
Self::Black => 15u8,
}
}
#[must_use]
pub const fn name(&self) -> &'static str {
match self {
Self::White => "white",
Self::Orange => "orange",
Self::Magenta => "magenta",
Self::LightBlue => "light_blue",
Self::Yellow => "yellow",
Self::Lime => "lime",
Self::Pink => "pink",
Self::Gray => "gray",
Self::LightGray => "light_gray",
Self::Cyan => "cyan",
Self::Purple => "purple",
Self::Blue => "blue",
Self::Brown => "brown",
Self::Green => "green",
Self::Red => "red",
Self::Black => "black",
}
}
#[must_use]
pub const fn map_color_id(&self) -> u8 {
match self {
Self::White => 8u8,
Self::Orange => 15u8,
Self::Magenta => 16u8,
Self::LightBlue => 17u8,
Self::Yellow => 18u8,
Self::Lime => 19u8,
Self::Pink => 20u8,
Self::Gray => 21u8,
Self::LightGray => 22u8,
Self::Cyan => 23u8,
Self::Purple => 24u8,
Self::Blue => 25u8,
Self::Brown => 26u8,
Self::Green => 27u8,
Self::Red => 28u8,
Self::Black => 29u8,
}
}
#[must_use]
pub const fn terracotta_color_id(&self) -> u8 {
match self {
Self::White => 36u8,
Self::Orange => 37u8,
Self::Magenta => 38u8,
Self::LightBlue => 39u8,
Self::Yellow => 40u8,
Self::Lime => 41u8,
Self::Pink => 42u8,
Self::Gray => 43u8,
Self::LightGray => 44u8,
Self::Cyan => 45u8,
Self::Purple => 46u8,
Self::Blue => 47u8,
Self::Brown => 48u8,
Self::Green => 49u8,
Self::Red => 50u8,
Self::Black => 51u8,
}
}
#[must_use]
pub const fn texture_diffuse_color(&self) -> u32 {
match self {
Self::White => 16383998u32,
Self::Orange => 16351261u32,
Self::Magenta => 13061821u32,
Self::LightBlue => 3847130u32,
Self::Yellow => 16701501u32,
Self::Lime => 8439583u32,
Self::Pink => 15961002u32,
Self::Gray => 4673362u32,
Self::LightGray => 10329495u32,
Self::Cyan => 1481884u32,
Self::Purple => 8991416u32,
Self::Blue => 3949738u32,
Self::Brown => 8606770u32,
Self::Green => 6192150u32,
Self::Red => 11546150u32,
Self::Black => 1908001u32,
}
}
#[must_use]
pub const fn firework_color(&self) -> u32 {
match self {
Self::White => 15790320u32,
Self::Orange => 15435844u32,
Self::Magenta => 12801229u32,
Self::LightBlue => 6719955u32,
Self::Yellow => 14602026u32,
Self::Lime => 4312372u32,
Self::Pink => 14188952u32,
Self::Gray => 4408131u32,
Self::LightGray => 11250603u32,
Self::Cyan => 2651799u32,
Self::Purple => 8073150u32,
Self::Blue => 2437522u32,
Self::Brown => 5320730u32,
Self::Green => 3887386u32,
Self::Red => 11743532u32,
Self::Black => 1973019u32,
}
}
#[must_use]
pub const fn text_color(&self) -> u32 {
match self {
Self::White => 16777215u32,
Self::Orange => 16738335u32,
Self::Magenta => 16711935u32,
Self::LightBlue => 10141901u32,
Self::Yellow => 16776960u32,
Self::Lime => 12582656u32,
Self::Pink => 16738740u32,
Self::Gray => 8421504u32,
Self::LightGray => 13882323u32,
Self::Cyan => 65535u32,
Self::Purple => 10494192u32,
Self::Blue => 255u32,
Self::Brown => 9127187u32,
Self::Green => 65280u32,
Self::Red => 16711680u32,
Self::Black => 0u32,
}
}
#[must_use]
pub const fn by_id(id: u8) -> Option<Self> {
match id {
0u8 => Some(Self::White),
1u8 => Some(Self::Orange),
2u8 => Some(Self::Magenta),
3u8 => Some(Self::LightBlue),
4u8 => Some(Self::Yellow),
5u8 => Some(Self::Lime),
6u8 => Some(Self::Pink),
7u8 => Some(Self::Gray),
8u8 => Some(Self::LightGray),
9u8 => Some(Self::Cyan),
10u8 => Some(Self::Purple),
11u8 => Some(Self::Blue),
12u8 => Some(Self::Brown),
13u8 => Some(Self::Green),
14u8 => Some(Self::Red),
15u8 => Some(Self::Black),
_ => None,
}
}
#[must_use]
pub fn by_name(name: &str) -> Option<Self> {
match name {
"white" => Some(Self::White),
"orange" => Some(Self::Orange),
"magenta" => Some(Self::Magenta),
"light_blue" => Some(Self::LightBlue),
"yellow" => Some(Self::Yellow),
"lime" => Some(Self::Lime),
"pink" => Some(Self::Pink),
"gray" => Some(Self::Gray),
"light_gray" => Some(Self::LightGray),
"cyan" => Some(Self::Cyan),
"purple" => Some(Self::Purple),
"blue" => Some(Self::Blue),
"brown" => Some(Self::Brown),
"green" => Some(Self::Green),
"red" => Some(Self::Red),
"black" => Some(Self::Black),
_ => None,
}
}
}

View File

@@ -0,0 +1,536 @@
/* This file is generated. Do not edit manually. */
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct MapColor {
pub id: u8,
pub name: &'static str,
pub col: u32,
pub rgb: (u8, u8, u8),
}
impl MapColor {
pub const NONE_0: MapColor = MapColor {
id: 0u8,
name: "none",
col: 0u32,
rgb: (0u8, 0u8, 0u8),
};
pub const GRASS: MapColor = MapColor {
id: 1u8,
name: "grass",
col: 8368696u32,
rgb: (127u8, 178u8, 56u8),
};
pub const SAND: MapColor = MapColor {
id: 2u8,
name: "sand",
col: 16247203u32,
rgb: (247u8, 233u8, 163u8),
};
pub const WOOL: MapColor = MapColor {
id: 3u8,
name: "wool",
col: 13092807u32,
rgb: (199u8, 199u8, 199u8),
};
pub const FIRE: MapColor = MapColor {
id: 4u8,
name: "fire",
col: 16711680u32,
rgb: (255u8, 0u8, 0u8),
};
pub const ICE: MapColor = MapColor {
id: 5u8,
name: "ice",
col: 10526975u32,
rgb: (160u8, 160u8, 255u8),
};
pub const METAL: MapColor = MapColor {
id: 6u8,
name: "metal",
col: 10987431u32,
rgb: (167u8, 167u8, 167u8),
};
pub const PLANT: MapColor = MapColor {
id: 7u8,
name: "plant",
col: 31744u32,
rgb: (0u8, 124u8, 0u8),
};
pub const SNOW: MapColor = MapColor {
id: 8u8,
name: "snow",
col: 16777215u32,
rgb: (255u8, 255u8, 255u8),
};
pub const CLAY: MapColor = MapColor {
id: 9u8,
name: "clay",
col: 10791096u32,
rgb: (164u8, 168u8, 184u8),
};
pub const DIRT: MapColor = MapColor {
id: 10u8,
name: "dirt",
col: 9923917u32,
rgb: (151u8, 109u8, 77u8),
};
pub const STONE: MapColor = MapColor {
id: 11u8,
name: "stone",
col: 7368816u32,
rgb: (112u8, 112u8, 112u8),
};
pub const WATER: MapColor = MapColor {
id: 12u8,
name: "water",
col: 4210943u32,
rgb: (64u8, 64u8, 255u8),
};
pub const WOOD: MapColor = MapColor {
id: 13u8,
name: "wood",
col: 9402184u32,
rgb: (143u8, 119u8, 72u8),
};
pub const QUARTZ: MapColor = MapColor {
id: 14u8,
name: "quartz",
col: 16776437u32,
rgb: (255u8, 252u8, 245u8),
};
pub const COLOR_ORANGE: MapColor = MapColor {
id: 15u8,
name: "color_orange",
col: 14188339u32,
rgb: (216u8, 127u8, 51u8),
};
pub const COLOR_MAGENTA: MapColor = MapColor {
id: 16u8,
name: "color_magenta",
col: 11685080u32,
rgb: (178u8, 76u8, 216u8),
};
pub const COLOR_LIGHT_BLUE: MapColor = MapColor {
id: 17u8,
name: "color_light_blue",
col: 6724056u32,
rgb: (102u8, 153u8, 216u8),
};
pub const COLOR_YELLOW: MapColor = MapColor {
id: 18u8,
name: "color_yellow",
col: 15066419u32,
rgb: (229u8, 229u8, 51u8),
};
pub const COLOR_LIGHT_GREEN: MapColor = MapColor {
id: 19u8,
name: "color_light_green",
col: 8375321u32,
rgb: (127u8, 204u8, 25u8),
};
pub const COLOR_PINK: MapColor = MapColor {
id: 20u8,
name: "color_pink",
col: 15892389u32,
rgb: (242u8, 127u8, 165u8),
};
pub const COLOR_GRAY: MapColor = MapColor {
id: 21u8,
name: "color_gray",
col: 5000268u32,
rgb: (76u8, 76u8, 76u8),
};
pub const COLOR_LIGHT_GRAY: MapColor = MapColor {
id: 22u8,
name: "color_light_gray",
col: 10066329u32,
rgb: (153u8, 153u8, 153u8),
};
pub const COLOR_CYAN: MapColor = MapColor {
id: 23u8,
name: "color_cyan",
col: 5013401u32,
rgb: (76u8, 127u8, 153u8),
};
pub const COLOR_PURPLE: MapColor = MapColor {
id: 24u8,
name: "color_purple",
col: 8339378u32,
rgb: (127u8, 63u8, 178u8),
};
pub const COLOR_BLUE: MapColor = MapColor {
id: 25u8,
name: "color_blue",
col: 3361970u32,
rgb: (51u8, 76u8, 178u8),
};
pub const COLOR_BROWN: MapColor = MapColor {
id: 26u8,
name: "color_brown",
col: 6704179u32,
rgb: (102u8, 76u8, 51u8),
};
pub const COLOR_GREEN: MapColor = MapColor {
id: 27u8,
name: "color_green",
col: 6717235u32,
rgb: (102u8, 127u8, 51u8),
};
pub const COLOR_RED: MapColor = MapColor {
id: 28u8,
name: "color_red",
col: 10040115u32,
rgb: (153u8, 51u8, 51u8),
};
pub const COLOR_BLACK: MapColor = MapColor {
id: 29u8,
name: "color_black",
col: 1644825u32,
rgb: (25u8, 25u8, 25u8),
};
pub const GOLD: MapColor = MapColor {
id: 30u8,
name: "gold",
col: 16445005u32,
rgb: (250u8, 238u8, 77u8),
};
pub const DIAMOND: MapColor = MapColor {
id: 31u8,
name: "diamond",
col: 6085589u32,
rgb: (92u8, 219u8, 213u8),
};
pub const LAPIS: MapColor = MapColor {
id: 32u8,
name: "lapis",
col: 4882687u32,
rgb: (74u8, 128u8, 255u8),
};
pub const EMERALD: MapColor = MapColor {
id: 33u8,
name: "emerald",
col: 55610u32,
rgb: (0u8, 217u8, 58u8),
};
pub const PODZOL: MapColor = MapColor {
id: 34u8,
name: "podzol",
col: 8476209u32,
rgb: (129u8, 86u8, 49u8),
};
pub const NETHER: MapColor = MapColor {
id: 35u8,
name: "nether",
col: 7340544u32,
rgb: (112u8, 2u8, 0u8),
};
pub const TERRACOTTA_WHITE: MapColor = MapColor {
id: 36u8,
name: "terracotta_white",
col: 13742497u32,
rgb: (209u8, 177u8, 161u8),
};
pub const TERRACOTTA_ORANGE: MapColor = MapColor {
id: 37u8,
name: "terracotta_orange",
col: 10441252u32,
rgb: (159u8, 82u8, 36u8),
};
pub const TERRACOTTA_MAGENTA: MapColor = MapColor {
id: 38u8,
name: "terracotta_magenta",
col: 9787244u32,
rgb: (149u8, 87u8, 108u8),
};
pub const TERRACOTTA_LIGHT_BLUE: MapColor = MapColor {
id: 39u8,
name: "terracotta_light_blue",
col: 7367818u32,
rgb: (112u8, 108u8, 138u8),
};
pub const TERRACOTTA_YELLOW: MapColor = MapColor {
id: 40u8,
name: "terracotta_yellow",
col: 12223780u32,
rgb: (186u8, 133u8, 36u8),
};
pub const TERRACOTTA_LIGHT_GREEN: MapColor = MapColor {
id: 41u8,
name: "terracotta_light_green",
col: 6780213u32,
rgb: (103u8, 117u8, 53u8),
};
pub const TERRACOTTA_PINK: MapColor = MapColor {
id: 42u8,
name: "terracotta_pink",
col: 10505550u32,
rgb: (160u8, 77u8, 78u8),
};
pub const TERRACOTTA_GRAY: MapColor = MapColor {
id: 43u8,
name: "terracotta_gray",
col: 3746083u32,
rgb: (57u8, 41u8, 35u8),
};
pub const TERRACOTTA_LIGHT_GRAY: MapColor = MapColor {
id: 44u8,
name: "terracotta_light_gray",
col: 8874850u32,
rgb: (135u8, 107u8, 98u8),
};
pub const TERRACOTTA_CYAN: MapColor = MapColor {
id: 45u8,
name: "terracotta_cyan",
col: 5725276u32,
rgb: (87u8, 92u8, 92u8),
};
pub const TERRACOTTA_PURPLE: MapColor = MapColor {
id: 46u8,
name: "terracotta_purple",
col: 8014168u32,
rgb: (122u8, 73u8, 88u8),
};
pub const TERRACOTTA_BLUE: MapColor = MapColor {
id: 47u8,
name: "terracotta_blue",
col: 4996700u32,
rgb: (76u8, 62u8, 92u8),
};
pub const TERRACOTTA_BROWN: MapColor = MapColor {
id: 48u8,
name: "terracotta_brown",
col: 4993571u32,
rgb: (76u8, 50u8, 35u8),
};
pub const TERRACOTTA_GREEN: MapColor = MapColor {
id: 49u8,
name: "terracotta_green",
col: 5001770u32,
rgb: (76u8, 82u8, 42u8),
};
pub const TERRACOTTA_RED: MapColor = MapColor {
id: 50u8,
name: "terracotta_red",
col: 9321518u32,
rgb: (142u8, 60u8, 46u8),
};
pub const TERRACOTTA_BLACK: MapColor = MapColor {
id: 51u8,
name: "terracotta_black",
col: 2430480u32,
rgb: (37u8, 22u8, 16u8),
};
pub const CRIMSON_NYLIUM: MapColor = MapColor {
id: 52u8,
name: "crimson_nylium",
col: 12398641u32,
rgb: (189u8, 48u8, 49u8),
};
pub const CRIMSON_STEM: MapColor = MapColor {
id: 53u8,
name: "crimson_stem",
col: 9715553u32,
rgb: (148u8, 63u8, 97u8),
};
pub const CRIMSON_HYPHAE: MapColor = MapColor {
id: 54u8,
name: "crimson_hyphae",
col: 6035741u32,
rgb: (92u8, 25u8, 29u8),
};
pub const WARPED_NYLIUM: MapColor = MapColor {
id: 55u8,
name: "warped_nylium",
col: 1474182u32,
rgb: (22u8, 126u8, 134u8),
};
pub const WARPED_STEM: MapColor = MapColor {
id: 56u8,
name: "warped_stem",
col: 3837580u32,
rgb: (58u8, 142u8, 140u8),
};
pub const WARPED_HYPHAE: MapColor = MapColor {
id: 57u8,
name: "warped_hyphae",
col: 5647422u32,
rgb: (86u8, 44u8, 62u8),
};
pub const WARPED_WART_BLOCK: MapColor = MapColor {
id: 58u8,
name: "warped_wart_block",
col: 1356933u32,
rgb: (20u8, 180u8, 133u8),
};
pub const DEEPSLATE: MapColor = MapColor {
id: 59u8,
name: "deepslate",
col: 6579300u32,
rgb: (100u8, 100u8, 100u8),
};
pub const RAW_IRON: MapColor = MapColor {
id: 60u8,
name: "raw_iron",
col: 14200723u32,
rgb: (216u8, 175u8, 147u8),
};
pub const GLOW_LICHEN: MapColor = MapColor {
id: 61u8,
name: "glow_lichen",
col: 8365974u32,
rgb: (127u8, 167u8, 150u8),
};
pub const NONE_62: MapColor = MapColor {
id: 62u8,
name: "none",
col: 0u32,
rgb: (0u8, 0u8, 0u8),
};
pub const NONE_63: MapColor = MapColor {
id: 63u8,
name: "none",
col: 0u32,
rgb: (0u8, 0u8, 0u8),
};
pub const ALL: &'static [MapColor] = &[
MapColor::NONE_0,
MapColor::GRASS,
MapColor::SAND,
MapColor::WOOL,
MapColor::FIRE,
MapColor::ICE,
MapColor::METAL,
MapColor::PLANT,
MapColor::SNOW,
MapColor::CLAY,
MapColor::DIRT,
MapColor::STONE,
MapColor::WATER,
MapColor::WOOD,
MapColor::QUARTZ,
MapColor::COLOR_ORANGE,
MapColor::COLOR_MAGENTA,
MapColor::COLOR_LIGHT_BLUE,
MapColor::COLOR_YELLOW,
MapColor::COLOR_LIGHT_GREEN,
MapColor::COLOR_PINK,
MapColor::COLOR_GRAY,
MapColor::COLOR_LIGHT_GRAY,
MapColor::COLOR_CYAN,
MapColor::COLOR_PURPLE,
MapColor::COLOR_BLUE,
MapColor::COLOR_BROWN,
MapColor::COLOR_GREEN,
MapColor::COLOR_RED,
MapColor::COLOR_BLACK,
MapColor::GOLD,
MapColor::DIAMOND,
MapColor::LAPIS,
MapColor::EMERALD,
MapColor::PODZOL,
MapColor::NETHER,
MapColor::TERRACOTTA_WHITE,
MapColor::TERRACOTTA_ORANGE,
MapColor::TERRACOTTA_MAGENTA,
MapColor::TERRACOTTA_LIGHT_BLUE,
MapColor::TERRACOTTA_YELLOW,
MapColor::TERRACOTTA_LIGHT_GREEN,
MapColor::TERRACOTTA_PINK,
MapColor::TERRACOTTA_GRAY,
MapColor::TERRACOTTA_LIGHT_GRAY,
MapColor::TERRACOTTA_CYAN,
MapColor::TERRACOTTA_PURPLE,
MapColor::TERRACOTTA_BLUE,
MapColor::TERRACOTTA_BROWN,
MapColor::TERRACOTTA_GREEN,
MapColor::TERRACOTTA_RED,
MapColor::TERRACOTTA_BLACK,
MapColor::CRIMSON_NYLIUM,
MapColor::CRIMSON_STEM,
MapColor::CRIMSON_HYPHAE,
MapColor::WARPED_NYLIUM,
MapColor::WARPED_STEM,
MapColor::WARPED_HYPHAE,
MapColor::WARPED_WART_BLOCK,
MapColor::DEEPSLATE,
MapColor::RAW_IRON,
MapColor::GLOW_LICHEN,
MapColor::NONE_62,
MapColor::NONE_63,
];
#[must_use]
pub const fn from_id(id: u8) -> Option<&'static MapColor> {
if (id as usize) < Self::ALL.len() {
Some(&Self::ALL[id as usize])
} else {
None
}
}
#[must_use]
pub fn from_name(name: &str) -> Option<&'static MapColor> {
match name {
"none" => Some(&Self::NONE_0),
"grass" => Some(&Self::GRASS),
"sand" => Some(&Self::SAND),
"wool" => Some(&Self::WOOL),
"fire" => Some(&Self::FIRE),
"ice" => Some(&Self::ICE),
"metal" => Some(&Self::METAL),
"plant" => Some(&Self::PLANT),
"snow" => Some(&Self::SNOW),
"clay" => Some(&Self::CLAY),
"dirt" => Some(&Self::DIRT),
"stone" => Some(&Self::STONE),
"water" => Some(&Self::WATER),
"wood" => Some(&Self::WOOD),
"quartz" => Some(&Self::QUARTZ),
"color_orange" => Some(&Self::COLOR_ORANGE),
"color_magenta" => Some(&Self::COLOR_MAGENTA),
"color_light_blue" => Some(&Self::COLOR_LIGHT_BLUE),
"color_yellow" => Some(&Self::COLOR_YELLOW),
"color_light_green" => Some(&Self::COLOR_LIGHT_GREEN),
"color_pink" => Some(&Self::COLOR_PINK),
"color_gray" => Some(&Self::COLOR_GRAY),
"color_light_gray" => Some(&Self::COLOR_LIGHT_GRAY),
"color_cyan" => Some(&Self::COLOR_CYAN),
"color_purple" => Some(&Self::COLOR_PURPLE),
"color_blue" => Some(&Self::COLOR_BLUE),
"color_brown" => Some(&Self::COLOR_BROWN),
"color_green" => Some(&Self::COLOR_GREEN),
"color_red" => Some(&Self::COLOR_RED),
"color_black" => Some(&Self::COLOR_BLACK),
"gold" => Some(&Self::GOLD),
"diamond" => Some(&Self::DIAMOND),
"lapis" => Some(&Self::LAPIS),
"emerald" => Some(&Self::EMERALD),
"podzol" => Some(&Self::PODZOL),
"nether" => Some(&Self::NETHER),
"terracotta_white" => Some(&Self::TERRACOTTA_WHITE),
"terracotta_orange" => Some(&Self::TERRACOTTA_ORANGE),
"terracotta_magenta" => Some(&Self::TERRACOTTA_MAGENTA),
"terracotta_light_blue" => Some(&Self::TERRACOTTA_LIGHT_BLUE),
"terracotta_yellow" => Some(&Self::TERRACOTTA_YELLOW),
"terracotta_light_green" => Some(&Self::TERRACOTTA_LIGHT_GREEN),
"terracotta_pink" => Some(&Self::TERRACOTTA_PINK),
"terracotta_gray" => Some(&Self::TERRACOTTA_GRAY),
"terracotta_light_gray" => Some(&Self::TERRACOTTA_LIGHT_GRAY),
"terracotta_cyan" => Some(&Self::TERRACOTTA_CYAN),
"terracotta_purple" => Some(&Self::TERRACOTTA_PURPLE),
"terracotta_blue" => Some(&Self::TERRACOTTA_BLUE),
"terracotta_brown" => Some(&Self::TERRACOTTA_BROWN),
"terracotta_green" => Some(&Self::TERRACOTTA_GREEN),
"terracotta_red" => Some(&Self::TERRACOTTA_RED),
"terracotta_black" => Some(&Self::TERRACOTTA_BLACK),
"crimson_nylium" => Some(&Self::CRIMSON_NYLIUM),
"crimson_stem" => Some(&Self::CRIMSON_STEM),
"crimson_hyphae" => Some(&Self::CRIMSON_HYPHAE),
"warped_nylium" => Some(&Self::WARPED_NYLIUM),
"warped_stem" => Some(&Self::WARPED_STEM),
"warped_hyphae" => Some(&Self::WARPED_HYPHAE),
"warped_wart_block" => Some(&Self::WARPED_WART_BLOCK),
"deepslate" => Some(&Self::DEEPSLATE),
"raw_iron" => Some(&Self::RAW_IRON),
"glow_lichen" => Some(&Self::GLOW_LICHEN),
_ => None,
}
}
}

View File

@@ -0,0 +1,414 @@
/* This file is generated. Do not edit manually. */
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct MapDecorationType {
pub id: u32,
pub name: &'static str,
pub asset_name: &'static str,
pub show_on_item_frame: bool,
pub map_color: i32,
pub exploration_map_element: bool,
pub track_count: bool,
}
impl MapDecorationType {
pub const PLAYER: MapDecorationType = MapDecorationType {
id: 0u32,
name: "player",
asset_name: "player",
show_on_item_frame: false,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const FRAME: MapDecorationType = MapDecorationType {
id: 1u32,
name: "frame",
asset_name: "frame",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const RED_MARKER: MapDecorationType = MapDecorationType {
id: 2u32,
name: "red_marker",
asset_name: "red_marker",
show_on_item_frame: false,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BLUE_MARKER: MapDecorationType = MapDecorationType {
id: 3u32,
name: "blue_marker",
asset_name: "blue_marker",
show_on_item_frame: false,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const TARGET_X: MapDecorationType = MapDecorationType {
id: 4u32,
name: "target_x",
asset_name: "target_x",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: false,
};
pub const TARGET_POINT: MapDecorationType = MapDecorationType {
id: 5u32,
name: "target_point",
asset_name: "target_point",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: false,
};
pub const PLAYER_OFF_MAP: MapDecorationType = MapDecorationType {
id: 6u32,
name: "player_off_map",
asset_name: "player_off_map",
show_on_item_frame: false,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const PLAYER_OFF_LIMITS: MapDecorationType = MapDecorationType {
id: 7u32,
name: "player_off_limits",
asset_name: "player_off_limits",
show_on_item_frame: false,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const MANSION: MapDecorationType = MapDecorationType {
id: 8u32,
name: "mansion",
asset_name: "woodland_mansion",
show_on_item_frame: true,
map_color: 5393476i32,
exploration_map_element: true,
track_count: false,
};
pub const MONUMENT: MapDecorationType = MapDecorationType {
id: 9u32,
name: "monument",
asset_name: "ocean_monument",
show_on_item_frame: true,
map_color: 3830373i32,
exploration_map_element: true,
track_count: false,
};
pub const BANNER_WHITE: MapDecorationType = MapDecorationType {
id: 10u32,
name: "banner_white",
asset_name: "white_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_ORANGE: MapDecorationType = MapDecorationType {
id: 11u32,
name: "banner_orange",
asset_name: "orange_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_MAGENTA: MapDecorationType = MapDecorationType {
id: 12u32,
name: "banner_magenta",
asset_name: "magenta_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_LIGHT_BLUE: MapDecorationType = MapDecorationType {
id: 13u32,
name: "banner_light_blue",
asset_name: "light_blue_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_YELLOW: MapDecorationType = MapDecorationType {
id: 14u32,
name: "banner_yellow",
asset_name: "yellow_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_LIME: MapDecorationType = MapDecorationType {
id: 15u32,
name: "banner_lime",
asset_name: "lime_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_PINK: MapDecorationType = MapDecorationType {
id: 16u32,
name: "banner_pink",
asset_name: "pink_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_GRAY: MapDecorationType = MapDecorationType {
id: 17u32,
name: "banner_gray",
asset_name: "gray_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_LIGHT_GRAY: MapDecorationType = MapDecorationType {
id: 18u32,
name: "banner_light_gray",
asset_name: "light_gray_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_CYAN: MapDecorationType = MapDecorationType {
id: 19u32,
name: "banner_cyan",
asset_name: "cyan_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_PURPLE: MapDecorationType = MapDecorationType {
id: 20u32,
name: "banner_purple",
asset_name: "purple_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_BLUE: MapDecorationType = MapDecorationType {
id: 21u32,
name: "banner_blue",
asset_name: "blue_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_BROWN: MapDecorationType = MapDecorationType {
id: 22u32,
name: "banner_brown",
asset_name: "brown_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_GREEN: MapDecorationType = MapDecorationType {
id: 23u32,
name: "banner_green",
asset_name: "green_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_RED: MapDecorationType = MapDecorationType {
id: 24u32,
name: "banner_red",
asset_name: "red_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const BANNER_BLACK: MapDecorationType = MapDecorationType {
id: 25u32,
name: "banner_black",
asset_name: "black_banner",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: true,
};
pub const RED_X: MapDecorationType = MapDecorationType {
id: 26u32,
name: "red_x",
asset_name: "red_x",
show_on_item_frame: true,
map_color: -1i32,
exploration_map_element: false,
track_count: false,
};
pub const VILLAGE_DESERT: MapDecorationType = MapDecorationType {
id: 27u32,
name: "village_desert",
asset_name: "desert_village",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const VILLAGE_PLAINS: MapDecorationType = MapDecorationType {
id: 28u32,
name: "village_plains",
asset_name: "plains_village",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const VILLAGE_SAVANNA: MapDecorationType = MapDecorationType {
id: 29u32,
name: "village_savanna",
asset_name: "savanna_village",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const VILLAGE_SNOWY: MapDecorationType = MapDecorationType {
id: 30u32,
name: "village_snowy",
asset_name: "snowy_village",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const VILLAGE_TAIGA: MapDecorationType = MapDecorationType {
id: 31u32,
name: "village_taiga",
asset_name: "taiga_village",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const JUNGLE_TEMPLE: MapDecorationType = MapDecorationType {
id: 32u32,
name: "jungle_temple",
asset_name: "jungle_temple",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const SWAMP_HUT: MapDecorationType = MapDecorationType {
id: 33u32,
name: "swamp_hut",
asset_name: "swamp_hut",
show_on_item_frame: true,
map_color: 10066329i32,
exploration_map_element: true,
track_count: false,
};
pub const TRIAL_CHAMBERS: MapDecorationType = MapDecorationType {
id: 34u32,
name: "trial_chambers",
asset_name: "trial_chambers",
show_on_item_frame: true,
map_color: 12741452i32,
exploration_map_element: true,
track_count: false,
};
pub const ALL: &'static [MapDecorationType] = &[
MapDecorationType::PLAYER,
MapDecorationType::FRAME,
MapDecorationType::RED_MARKER,
MapDecorationType::BLUE_MARKER,
MapDecorationType::TARGET_X,
MapDecorationType::TARGET_POINT,
MapDecorationType::PLAYER_OFF_MAP,
MapDecorationType::PLAYER_OFF_LIMITS,
MapDecorationType::MANSION,
MapDecorationType::MONUMENT,
MapDecorationType::BANNER_WHITE,
MapDecorationType::BANNER_ORANGE,
MapDecorationType::BANNER_MAGENTA,
MapDecorationType::BANNER_LIGHT_BLUE,
MapDecorationType::BANNER_YELLOW,
MapDecorationType::BANNER_LIME,
MapDecorationType::BANNER_PINK,
MapDecorationType::BANNER_GRAY,
MapDecorationType::BANNER_LIGHT_GRAY,
MapDecorationType::BANNER_CYAN,
MapDecorationType::BANNER_PURPLE,
MapDecorationType::BANNER_BLUE,
MapDecorationType::BANNER_BROWN,
MapDecorationType::BANNER_GREEN,
MapDecorationType::BANNER_RED,
MapDecorationType::BANNER_BLACK,
MapDecorationType::RED_X,
MapDecorationType::VILLAGE_DESERT,
MapDecorationType::VILLAGE_PLAINS,
MapDecorationType::VILLAGE_SAVANNA,
MapDecorationType::VILLAGE_SNOWY,
MapDecorationType::VILLAGE_TAIGA,
MapDecorationType::JUNGLE_TEMPLE,
MapDecorationType::SWAMP_HUT,
MapDecorationType::TRIAL_CHAMBERS,
];
#[must_use]
pub const fn from_id(id: u32) -> Option<&'static MapDecorationType> {
if (id as usize) < Self::ALL.len() {
Some(&Self::ALL[id as usize])
} else {
None
}
}
#[must_use]
pub fn from_name(name: &str) -> Option<&'static MapDecorationType> {
match name {
"player" => Some(&Self::PLAYER),
"frame" => Some(&Self::FRAME),
"red_marker" => Some(&Self::RED_MARKER),
"blue_marker" => Some(&Self::BLUE_MARKER),
"target_x" => Some(&Self::TARGET_X),
"target_point" => Some(&Self::TARGET_POINT),
"player_off_map" => Some(&Self::PLAYER_OFF_MAP),
"player_off_limits" => Some(&Self::PLAYER_OFF_LIMITS),
"mansion" => Some(&Self::MANSION),
"monument" => Some(&Self::MONUMENT),
"banner_white" => Some(&Self::BANNER_WHITE),
"banner_orange" => Some(&Self::BANNER_ORANGE),
"banner_magenta" => Some(&Self::BANNER_MAGENTA),
"banner_light_blue" => Some(&Self::BANNER_LIGHT_BLUE),
"banner_yellow" => Some(&Self::BANNER_YELLOW),
"banner_lime" => Some(&Self::BANNER_LIME),
"banner_pink" => Some(&Self::BANNER_PINK),
"banner_gray" => Some(&Self::BANNER_GRAY),
"banner_light_gray" => Some(&Self::BANNER_LIGHT_GRAY),
"banner_cyan" => Some(&Self::BANNER_CYAN),
"banner_purple" => Some(&Self::BANNER_PURPLE),
"banner_blue" => Some(&Self::BANNER_BLUE),
"banner_brown" => Some(&Self::BANNER_BROWN),
"banner_green" => Some(&Self::BANNER_GREEN),
"banner_red" => Some(&Self::BANNER_RED),
"banner_black" => Some(&Self::BANNER_BLACK),
"red_x" => Some(&Self::RED_X),
"village_desert" => Some(&Self::VILLAGE_DESERT),
"village_plains" => Some(&Self::VILLAGE_PLAINS),
"village_savanna" => Some(&Self::VILLAGE_SAVANNA),
"village_snowy" => Some(&Self::VILLAGE_SNOWY),
"village_taiga" => Some(&Self::VILLAGE_TAIGA),
"jungle_temple" => Some(&Self::JUNGLE_TEMPLE),
"swamp_hut" => Some(&Self::SWAMP_HUT),
"trial_chambers" => Some(&Self::TRIAL_CHAMBERS),
_ => None,
}
}
}

View File

@@ -371,3 +371,18 @@ pub mod villager;
#[rustfmt::skip]
#[path = "generated/slot_ranges.rs"]
pub mod slot_ranges;
#[cfg(feature = "map_color")]
#[rustfmt::skip]
#[path = "generated/map_color.rs"]
pub mod map_color;
#[cfg(feature = "map_decoration")]
#[rustfmt::skip]
#[path = "generated/map_decoration.rs"]
pub mod map_decoration;
#[cfg(feature = "dye_color")]
#[rustfmt::skip]
#[path = "generated/dye_color.rs"]
pub mod dye_color;