World: Give different error message on WorldInfoError::UnsupportedVersion

This commit is contained in:
Alexander Medvedev committed 2025-02-18 19:23:27 +01:00
1 parent dbf58a54a8
commit 1da941755a
3 files changed
+8 -5

No files matched your search

+5 -2
View File
@@ -75,11 +75,14 @@ impl Level {
match error { match error {
// If it doesn't exist, just make a new one // If it doesn't exist, just make a new one
WorldInfoError::InfoNotFound => (), WorldInfoError::InfoNotFound => (),
_ => { WorldInfoError::UnsupportedVersion(version) => {
log::error!("Failed to load world info!"); log::error!("Failed to load world info!, {version}");
log::error!("{}", error); log::error!("{}", error);
panic!("Unsupported world data! See the logs for more info."); panic!("Unsupported world data! See the logs for more info.");
} }
e => {
panic!("World Error {}", e);
}
} }
} else { } else {
let dat_path = level_folder.root_folder.join(LEVEL_DAT_FILE_NAME); let dat_path = level_folder.root_folder.join(LEVEL_DAT_FILE_NAME);
+2 -2
View File
@@ -67,8 +67,8 @@ impl ThrownItemEntity {
self.entity.velocity.store(velocity); self.entity.velocity.store(velocity);
let len = velocity.horizontal_length(); let len = velocity.horizontal_length();
self.entity.set_rotation( self.entity.set_rotation(
velocity.x.atan2(velocity.z).to_degrees() as f32, velocity.x.atan2(velocity.z) as f32 * 57.295_776,
velocity.y.atan2(len).to_degrees() as f32, velocity.y.atan2(len) as f32 * 57.295_776,
); );
} }
} }
+1 -1
View File
@@ -31,7 +31,7 @@
#![expect(clippy::module_name_repetitions)] #![expect(clippy::module_name_repetitions)]
#![expect(clippy::struct_excessive_bools)] #![expect(clippy::struct_excessive_bools)]
// Not warn event sending macros // Not warn event sending macros
#![allow(unused_labels)] #![expect(unused_labels)]
#[cfg(target_os = "wasi")] #[cfg(target_os = "wasi")]
compile_error!("Compiling for WASI targets is not supported!"); compile_error!("Compiling for WASI targets is not supported!");