mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
feat: villager Professions
This commit is contained in:
@@ -28,6 +28,16 @@ pub fn build() -> TokenStream {
|
||||
let i = n.as_i64().unwrap();
|
||||
(quote! { Int }, quote! { i64 }, quote! { #i })
|
||||
}
|
||||
Value::Object(obj) => {
|
||||
let default_val = obj.get("default").expect("Object game rule missing default value");
|
||||
match default_val {
|
||||
Value::Number(n) if n.is_i64() => {
|
||||
let i = n.as_i64().unwrap();
|
||||
(quote! { Int }, quote! { i64 }, quote! { #i })
|
||||
}
|
||||
_ => panic!("Unsupported default value type in object for key '{raw_name}'"),
|
||||
}
|
||||
}
|
||||
_ => panic!("Unsupported value type for key '{raw_name}'"),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user