diff options
Diffstat (limited to 'azalea-client/src/local_player.rs')
| -rw-r--r-- | azalea-client/src/local_player.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index 455cc470..bf1609ab 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -144,6 +144,20 @@ impl InstanceHolder { ))), } } + + /// Reset the `Instance` to a new reference to an empty instance, but with + /// the same registries as the current one. + /// + /// This is used by Azalea when entering the config state. + pub fn reset(&mut self) { + let registries = self.instance.read().registries.clone(); + + let mut new_instance = Instance::default(); + new_instance.registries = registries; + self.instance = Arc::new(RwLock::new(new_instance)); + + self.partial_instance.write().reset(); + } } #[derive(Error, Debug)] |
