diff --git a/pumpkin-config/src/resource_pack.rs b/pumpkin-config/src/resource_pack.rs index 3db64e0d9..0bc350636 100644 --- a/pumpkin-config/src/resource_pack.rs +++ b/pumpkin-config/src/resource_pack.rs @@ -5,9 +5,9 @@ use serde::{Deserialize, Serialize}; pub struct ResourcePackConfig { pub enabled: bool, /// The path to the resource pack. - pub resource_pack_url: String, + pub url: String, /// The SHA1 hash (40) of the resource pack. - pub resource_pack_sha1: String, + pub sha1: String, /// Custom prompt Text component, Leave blank for none pub prompt_message: String, /// Will force the Player to accept the resource pack @@ -21,12 +21,12 @@ impl ResourcePackConfig { } assert_eq!( - !self.resource_pack_url.is_empty(), - !self.resource_pack_sha1.is_empty(), + !self.url.is_empty(), + !self.sha1.is_empty(), "Resource Pack path or Sha1 hash is missing" ); - let hash_len = self.resource_pack_sha1.len(); + let hash_len = self.sha1.len(); assert!( hash_len == 40, "Resource pack sha1 hash is the wrong length (should be 40, is {})", diff --git a/pumpkin/src/net/packet/config.rs b/pumpkin/src/net/packet/config.rs index 5761da321..4e95e8991 100644 --- a/pumpkin/src/net/packet/config.rs +++ b/pumpkin/src/net/packet/config.rs @@ -72,10 +72,8 @@ impl Client { pub async fn handle_resource_pack_response(&self, packet: SConfigResourcePack) { let resource_config = &ADVANCED_CONFIG.resource_pack; if resource_config.enabled { - let expected_uuid = uuid::Uuid::new_v3( - &uuid::Uuid::NAMESPACE_DNS, - resource_config.resource_pack_url.as_bytes(), - ); + let expected_uuid = + uuid::Uuid::new_v3(&uuid::Uuid::NAMESPACE_DNS, resource_config.url.as_bytes()); if packet.uuid == expected_uuid { match packet.response_result() { diff --git a/pumpkin/src/net/packet/login.rs b/pumpkin/src/net/packet/login.rs index 80745a887..b76b1db75 100644 --- a/pumpkin/src/net/packet/login.rs +++ b/pumpkin/src/net/packet/login.rs @@ -358,14 +358,11 @@ impl Client { let resource_config = &ADVANCED_CONFIG.resource_pack; if resource_config.enabled { - let uuid = Uuid::new_v3( - &uuid::Uuid::NAMESPACE_DNS, - resource_config.resource_pack_url.as_bytes(), - ); + let uuid = Uuid::new_v3(&uuid::Uuid::NAMESPACE_DNS, resource_config.url.as_bytes()); let resource_pack = CConfigAddResourcePack::new( &uuid, - &resource_config.resource_pack_url, - &resource_config.resource_pack_sha1, + &resource_config.url, + &resource_config.sha1, resource_config.force, if resource_config.prompt_message.is_empty() { None