From 1287e617ca3d0f19bf82d785f38281f5cf64b26e Mon Sep 17 00:00:00 2001 From: OfficialKris <37947442+OfficialKris@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:27:08 -0800 Subject: [PATCH] Various fixes --- extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt | 1 - pumpkin-world/src/item/item_registry.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt b/extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt index 1b7269bb..2f47fe63 100644 --- a/extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt +++ b/extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt @@ -33,7 +33,6 @@ class Extractor : ModInitializer { Entities(), Items(), Blocks(), - Entities(), Tests(), ) diff --git a/pumpkin-world/src/item/item_registry.rs b/pumpkin-world/src/item/item_registry.rs index 39e38a59..704840c3 100644 --- a/pumpkin-world/src/item/item_registry.rs +++ b/pumpkin-world/src/item/item_registry.rs @@ -9,7 +9,7 @@ pub static ITEMS: LazyLock> = LazyLock::new(|| { serde_json::from_str(ITEMS_JSON).expect("Could not parse items.json registry.") }); -pub static ITEMS_REGISTRY_ID_BY_ID: LazyLock> = LazyLock::new(|| { +pub static ITEMS_REGISTRY_NAME_BY_ID: LazyLock> = LazyLock::new(|| { let mut map = HashMap::new(); for item in ITEMS.clone() { map.insert(item.1.id, item.0.clone()); @@ -26,7 +26,7 @@ pub fn get_item_by_id<'a>(item_id: u16) -> Option<&'a Item> { } pub fn get_spawn_egg(item_id: u16) -> Option { - if let Some(item_name) = ITEMS_REGISTRY_ID_BY_ID.get(&item_id) { + if let Some(item_name) = ITEMS_REGISTRY_NAME_BY_ID.get(&item_id) { if item_name.ends_with("_spawn_egg") { if let Some(res) = item_name.strip_suffix("_spawn_egg") { return Some(res.to_owned());