From f31bb0b8b4f57bb23a0fe2dc06bacd538171ccf1 Mon Sep 17 00:00:00 2001 From: firejoust <42525540+firejoust@users.noreply.github.com> Date: Fri, 9 Dec 2022 14:08:03 +1100 Subject: [PATCH] fallback to major version --- src/data/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/mod.rs b/src/data/mod.rs index c5dfa08..fb44ee6 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -68,6 +68,12 @@ pub fn get_path(version: &Version, filename: &str) -> DataResult { PATHS .pc .get(&version.minecraft_version) + // fallback to major version + .or_else(|| + PATHS + .pc + .get(&version.major_version) + ) .ok_or_else(|| DataError::NotFoundError(version.minecraft_version.clone()))? .get(filename) .cloned()