Skip to content

Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.

Fusion models: a parent's predicates for every face fill the child's missing keys

some-du6e553e69c47935
diff --git a/crates/horizon-optifine/src/fusion/model.rs b/crates/horizon-optifine/src/fusion/model.rs
index a0e6093da..35130fb8c 100644
--- a/crates/horizon-optifine/src/fusion/model.rs
+++ b/crates/horizon-optifine/src/fusion/model.rs
@@ -77,7 +77,8 @@ impl Connections {
.map_or(Ok(Self::Textures), Self::parse)
}
- /// A child model's over its parent's: a child's keys add to and replace the parent's.
+ /// A child model's over its parent's: a child's keys add to and replace the parent's, and a
+ /// parent's predicates for every face stand for the keys the child doesn't define.
pub fn inherit(self, parent: &Self) -> Self {
match (self, parent) {
(Self::Textures, parent) => parent.clone(),
@@ -89,6 +90,12 @@ impl Connections {
}
Self::Keys(child)
}
+ (Self::Keys(mut child), Self::All(all)) => {
+ if !child.iter().any(|(k, _)| k == "default") {
+ child.push(("default".to_owned(), Entry::Predicate(all.clone())));
+ }
+ Self::Keys(child)
+ }
(child, _) => child,
}
}