diff --git a/crates/bevy_core/src/lib.rs b/crates/bevy_core/src/lib.rs index fb22cbc2ab732..fbc175c1e3f89 100644 --- a/crates/bevy_core/src/lib.rs +++ b/crates/bevy_core/src/lib.rs @@ -48,11 +48,6 @@ impl Plugin for CorePlugin { ); app.register_type::().register_type::(); - app.register_type::() - .register_type::() - .register_type::>() - .register_type_data::, ReflectSerialize>() - .register_type_data::, ReflectDeserialize>(); register_rust_types(app); register_math_types(app); @@ -63,6 +58,8 @@ impl Plugin for CorePlugin { fn register_rust_types(app: &mut App) { app.register_type::>() + .register_type_data::, ReflectSerialize>() + .register_type_data::, ReflectDeserialize>() .register_type::() .register_type::>() .register_type::>() diff --git a/crates/bevy_reflect/src/type_registry.rs b/crates/bevy_reflect/src/type_registry.rs index fe3302774b761..00f3bdb2f7177 100644 --- a/crates/bevy_reflect/src/type_registry.rs +++ b/crates/bevy_reflect/src/type_registry.rs @@ -87,6 +87,10 @@ impl TypeRegistry { /// Registers the type described by `registration`. pub fn add_registration(&mut self, registration: TypeRegistration) { + if self.registrations.contains_key(®istration.type_id()) { + return; + } + let short_name = registration.short_name.to_string(); if self.short_name_to_id.contains_key(&short_name) || self.ambiguous_names.contains(&short_name)