Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.
Rust differential-testinggame-enginegamedevlinuxminecraftminecraft-javareimplementationrustvoxelvulkanwgpu
Fusion textures: refuse metadata that is not an object
some-du6e6c5ee2d42799
diff --git a/crates/horizon-optifine/src/fusion/texture.rs b/crates/horizon-optifine/src/fusion/texture.rsindex a47723ee4..0be229bc4 100644--- a/crates/horizon-optifine/src/fusion/texture.rs+++ b/crates/horizon-optifine/src/fusion/texture.rs@@ -131,6 +131,9 @@ impl Meta {/// A `fusion` section (or a `sub_texture`).pub fn parse(json: &Json) -> Result<Self, String> {+ if json.as_object().is_none() {+ return Err("a texture's Fusion metadata that isn't an object".into());+ }let base = Base {emissive: bool_field(json, "emissive")?.unwrap_or(false),render_type: choice(@@ -399,6 +402,8 @@ mod tests {r#"{"fusion": {"type": "scrolling", "loop_pause": -1}}"#,r#"{"fusion": {"type": "connecting", "sub_texture": {"type": "random", "rows": 0}}}"#,r#"{"fusion": {"type": "glowing"}}"#,+ r#"{"fusion": "connecting"}"#,+ r#"{"fusion": {"type": "connecting", "sub_texture": "random"}}"#,r#"{"fusion": {"type": "connecting", "layout": "diagonal"}}"#,r#"{"fusion": {"type": "base", "emissive": "yes"}}"#,r#"{"fusion": {"type": "base", "render_type": "solid"}}"#,