Skip to content

Commit

Permalink
revert resource pack names
Browse files Browse the repository at this point in the history
  • Loading branch information
kralverde committed Feb 24, 2025
1 parent 110ba3a commit dabae22
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
10 changes: 5 additions & 5 deletions pumpkin-config/src/resource_pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {})",
Expand Down
6 changes: 2 additions & 4 deletions pumpkin/src/net/packet/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
9 changes: 3 additions & 6 deletions pumpkin/src/net/packet/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dabae22

Please sign in to comment.