1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 23:44:38 +00:00
This commit is contained in:
mat 2025-02-21 19:01:40 +00:00
commit b664e04a7d
3 changed files with 10 additions and 3 deletions

View file

@ -56,6 +56,7 @@ impl Simulation {
tick_app(&mut app);
#[allow(clippy::single_match)]
match initial_connection_protocol {
ConnectionProtocol::Configuration => {
app.world_mut().entity_mut(entity).insert(InConfigState);
@ -75,7 +76,7 @@ impl Simulation {
pub fn receive_packet<P: ProtocolPacket + Debug>(&mut self, packet: impl Packet<P>) {
let buf = azalea_protocol::write::serialize_packet(&packet.into_variant()).unwrap();
self.incoming_packet_queue.lock().push(buf.into());
self.incoming_packet_queue.lock().push(buf);
}
pub fn tick(&mut self) {
@ -100,6 +101,7 @@ impl Simulation {
}
}
#[allow(clippy::type_complexity)]
fn create_local_player_bundle(
entity: Entity,
connection_protocol: ConnectionProtocol,

View file

@ -24,9 +24,9 @@ pub trait ResolvableDataRegistry: DataRegistry {
Some(resolved)
}
fn resolve_and_deserialize<'a, T: simdnbt::Deserialize>(
fn resolve_and_deserialize<T: simdnbt::Deserialize>(
&self,
registries: &'a RegistryHolder,
registries: &RegistryHolder,
) -> Option<Result<(ResourceLocation, T), simdnbt::DeserializeError>> {
let (name, value) = self.resolve(registries)?;

View file

@ -19,6 +19,11 @@ use crate::resource_location::ResourceLocation;
/// The base of the registry.
///
/// This is the registry that is sent to the client upon login.
///
/// Note that `azalea-client` stores registries per-world instead of per-client
/// like you might expect. This is an optimization for swarms to reduce memory
/// usage, since registries are expected to be the same for every client in a
/// world.
#[derive(Default, Debug, Clone)]
pub struct RegistryHolder {
pub map: HashMap<ResourceLocation, IndexMap<ResourceLocation, NbtCompound>>,