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