From 88dcb9eea1965d26b694213e8e0bd84397c30aa7 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 28 Oct 2025 19:26:22 +0100 Subject: [PATCH] Fix `.meta` files not found error on web --- client/src/main.rs | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 8e3faa0..1dd6fb6 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1,6 +1,7 @@ use bevy::prelude::*; use common::network::*; +use bevy::asset::AssetMetaCheck; use bevy::window::WindowResolution; use lightyear::prelude::server::Started; @@ -19,20 +20,26 @@ fn main() -> Result { let cli = Args::parse(); let mut app = App::new(); - app.add_plugins(DefaultPlugins.set(WindowPlugin { - primary_window: Some(Window { - title: "bevy-bloxel-classic".into(), - // Steam Deck: DPI appears pretty high, causing everything to be scaled up. - // Setting `scale_factor_override` prevents this from happening. - resolution: WindowResolution::new(1280, 720).with_scale_factor_override(1.0), - // WEB: Fit canvas to parent element, so `Window` resizes automatically. - fit_canvas_to_parent: true, - // WEB: Don't override default event handling like browser hotkeys while focused. - prevent_default_event_handling: false, + app.add_plugins(DefaultPlugins + .set(WindowPlugin { + primary_window: Some(Window { + title: "bevy-bloxel-classic".into(), + // Steam Deck: DPI appears pretty high, causing everything to be scaled up. + // Setting `scale_factor_override` prevents this from happening. + resolution: WindowResolution::new(1280, 720).with_scale_factor_override(1.0), + // WEB: Fit canvas to parent element, so `Window` resizes automatically. + fit_canvas_to_parent: true, + // WEB: Don't override default event handling like browser hotkeys while focused. + prevent_default_event_handling: false, + ..default() + }), ..default() - }), - ..default() - })); + }) + .set(AssetPlugin { + // WEB: Don't check for `.meta` files since we don't use them. + meta_check: AssetMetaCheck::Never, + ..default() + })); // Fixes issue on web where the cursor isn't ungrabbed properly. app.add_plugins(bevy_fix_cursor_unlock_web::FixPointerUnlockPlugin);