use horizon_core::{ geometry::Vec3, random::{LegacyRandom, RandomSource, XoroshiroRandom}, }; use horizon_world::{ component_patch::Prototype, item_particles::{self, ItemParticleWorld, ParticleError}, item_stack_refs::{ItemStacks, StackRef}, item_template::ItemTemplate, }; use serde_json::Value; use std::{ fs, io::{self, Write}, path::Path, }; type Stack = StackRef; type Template = ItemTemplate; fn n(v: &Value, k: &str) -> i32 { v[k].as_i64().unwrap() as i32 } fn fl(v: &Value, k: &str) -> f32 { f32::from_bits(v[k].as_u64().unwrap() as u32) } fn bits(v: f64) -> u64 { if v.is_nan() { 0x7ff8000000000000 } else { v.to_bits() } } fn opt(v: Option<&i32>) -> String { v.map_or("none".into(), i32::to_string) } struct World<'a, R> { f: Value, out: &'a mut dyn Write, stack: Stack, random: [R; 2], position: Vec3, changed: bool, calls: i32, first: Option