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.

Merge pull request #6661 from TREYX77/feat/native-framerate-limit

Ludovic Marie68a348299e7e
diff --cc crates/horizon-client/src/game/native_hooks.rs
index 09d266377,7269ee525..307b71d8c
--- a/crates/horizon-client/src/game/native_hooks.rs
+++ b/crates/horizon-client/src/game/native_hooks.rs
@@@ -1286,8 -1357,23 +1286,23 @@@ fn chars_to_type(text: &str, canceled:
impl Game<'_> {
/// Once a frame, in a world or not, after Horizon's extras.
pub(super) fn native_frame(&mut self, elapsed: Duration) {
- let _ = elapsed;
+ mod_api::dispatch_frame(self, mod_api::mods(), elapsed);
}
+ /// The frame rate this window is about to be held to: Max Framerate after the
+ /// inactivity throttle and Battery Mode (260 is unlimited). `focused` is whether the
+ /// window has focus, `minimized` whether it is minimised and `in_world` whether a world
+ /// is open. A mod may lower `limit`, as Dynamic FPS does for a window in the background:
+ /// Horizon keeps the lower of its own limit and the mod's, and ignores values below 1.
+ /// API @API:framerate_limit@.
+ pub(super) fn native_framerate_limit(
+ &self,
+ focused: bool,
+ minimized: bool,
+ in_world: bool,
+ limit: &mut i32,
+ ) {
+ let _ = (focused, minimized, in_world, limit);
+ }
/// Render-thread notification after a resource-pack reload has applied successfully.
/// Atlas, models, renderer and client caches already refer to the new resources.
/// Selection/F3+T and server-pack reloads share this point; initial startup does not.