Skip to content

Commit

Permalink
Make block_id macro work in pumpkin-world
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas0008 committed Sep 19, 2024
1 parent a30dbde commit 8112f4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pumpkin-macros/src/block_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,14 @@ pub fn block_id_impl(item: TokenStream) -> TokenStream {
}
};

quote! {
pumpkin_world::block::block_id::BlockId::from_id(#id as u16)
if std::env::var("CARGO_PKG_NAME").unwrap() == "pumpkin-world" {
quote! {
crate::block::block_id::BlockId::from_id(#id as u16)
}
} else {
quote! {
pumpkin_world::block::block_id::BlockId::from_id(#id as u16)
}
}
.into()
}

0 comments on commit 8112f4a

Please sign in to comment.