Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficialKris committed Dec 27, 2024
1 parent 84b7382 commit 1287e61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion extractor/src/main/kotlin/de/snowii/extractor/Extractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Extractor : ModInitializer {
Entities(),
Items(),
Blocks(),
Entities(),
Tests(),
)

Expand Down
4 changes: 2 additions & 2 deletions pumpkin-world/src/item/item_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub static ITEMS: LazyLock<HashMap<String, Item>> = LazyLock::new(|| {
serde_json::from_str(ITEMS_JSON).expect("Could not parse items.json registry.")
});

pub static ITEMS_REGISTRY_ID_BY_ID: LazyLock<HashMap<u16, String>> = LazyLock::new(|| {
pub static ITEMS_REGISTRY_NAME_BY_ID: LazyLock<HashMap<u16, String>> = LazyLock::new(|| {
let mut map = HashMap::new();
for item in ITEMS.clone() {
map.insert(item.1.id, item.0.clone());
Expand All @@ -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<String> {
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());
Expand Down

0 comments on commit 1287e61

Please sign in to comment.