fix: connection
This commit is contained in:
1 parent
b4048fb6e9
commit
f09d79d088
1 file changed
+23
-9
@@ -6,7 +6,7 @@ use crate::{
|
||||
server::Server,
|
||||
};
|
||||
use core::str;
|
||||
use pumpkin_data::{registry::Registry, tag::RegistryKey};
|
||||
use pumpkin_data::registry::Registry;
|
||||
use pumpkin_protocol::{
|
||||
ConnectionState,
|
||||
java::{
|
||||
@@ -17,7 +17,7 @@ use pumpkin_protocol::{
|
||||
},
|
||||
},
|
||||
};
|
||||
use pumpkin_util::{Hand, text::TextComponent};
|
||||
use pumpkin_util::{Hand, text::TextComponent, version::MinecraftVersion};
|
||||
|
||||
impl JavaClient {
|
||||
pub async fn handle_client_information_config(
|
||||
@@ -152,7 +152,7 @@ impl JavaClient {
|
||||
|
||||
pub async fn handle_known_packs(&self, _config_acknowledged: SKnownPacks) {
|
||||
log::debug!("Handling known packs");
|
||||
let mut tags_to_send = Vec::new();
|
||||
// let mut tags_to_send = Vec::new();
|
||||
let registry = Registry::get_synced(self.version.load());
|
||||
for registry in registry {
|
||||
let entries: Vec<RegistryEntry> = registry
|
||||
@@ -162,13 +162,27 @@ impl JavaClient {
|
||||
.collect();
|
||||
self.send_packet_now(&CRegistryData::new(®istry.registry_id, &entries))
|
||||
.await;
|
||||
if let Some(tag) = RegistryKey::from_string(®istry.registry_id.path)
|
||||
&& pumpkin_data::tag::get_registry_key_tags(self.version.load(), tag).is_some()
|
||||
{
|
||||
tags_to_send.push(tag);
|
||||
}
|
||||
// if let Some(tag) = RegistryKey::from_string(®istry.registry_id.path)
|
||||
// && pumpkin_data::tag::get_registry_key_tags(self.version.load(), tag).is_some()
|
||||
// {
|
||||
// tags_to_send.push(tag);
|
||||
// }
|
||||
}
|
||||
self.send_packet_now(&CUpdateTags::new(&tags_to_send)).await;
|
||||
//self.send_packet_now(&CUpdateTags::new(&tags_to_send)).await;
|
||||
let mut tags = vec![
|
||||
pumpkin_data::tag::RegistryKey::Block,
|
||||
pumpkin_data::tag::RegistryKey::Fluid,
|
||||
pumpkin_data::tag::RegistryKey::Enchantment,
|
||||
pumpkin_data::tag::RegistryKey::WorldgenBiome,
|
||||
pumpkin_data::tag::RegistryKey::Item,
|
||||
pumpkin_data::tag::RegistryKey::EntityType,
|
||||
pumpkin_data::tag::RegistryKey::Dialog,
|
||||
];
|
||||
if self.version.load().protocol_version() >= MinecraftVersion::V_1_21_11.protocol_version()
|
||||
{
|
||||
tags.push(pumpkin_data::tag::RegistryKey::Timeline);
|
||||
}
|
||||
self.send_packet_now(&CUpdateTags::new(&tags)).await;
|
||||
|
||||
// We are done with configuring
|
||||
log::debug!("Finished config");
|
||||
|
||||
Reference in new issue
Block a user