mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
fix: data component try_from_name
This commit is contained in:
@@ -36,7 +36,7 @@ pub fn build() -> TokenStream {
|
||||
|
||||
// TODO use phf
|
||||
name_to_enum.extend(quote! {
|
||||
#raw_name => Some(Self::#pascal_case),
|
||||
#raw_name | #strip_name => Some(Self::#pascal_case),
|
||||
});
|
||||
|
||||
// Enum -> &str
|
||||
|
||||
@@ -187,7 +187,7 @@ pub fn build() -> TokenStream {
|
||||
}]);
|
||||
}
|
||||
|
||||
name_to_type.extend(quote! { #name => Some(&Self::#format_name), });
|
||||
name_to_type.extend(quote! { #name | #raw_name => Some(&Self::#format_name), });
|
||||
id_to_type.extend(quote! { #id => Some(&Self::#format_name), });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user