From 4e338230f7145a025b1d2a0ee1538bae4aebba8c Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 5 Mar 2026 03:48:48 -0530 Subject: optimized converting from blockstate to blockkind --- azalea-entity/src/mining.rs | 4 ++-- azalea-entity/src/plugin/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea-entity/src') diff --git a/azalea-entity/src/mining.rs b/azalea-entity/src/mining.rs index bc2e6c46..19346ba9 100644 --- a/azalea-entity/src/mining.rs +++ b/azalea-entity/src/mining.rs @@ -35,7 +35,7 @@ pub fn get_mine_progress( }; let base_destroy_speed = destroy_speed( - block.as_registry_block(), + block.as_block_kind(), held_item, fluid_on_eyes, physics, @@ -52,7 +52,7 @@ fn has_correct_tool_for_drops(block: &dyn BlockTrait, item: &ItemStack) -> bool let Some(tool) = item.get_component::() else { return false; }; - let registry_block = block.as_registry_block(); + let registry_block = block.as_block_kind(); for rule in &tool.rules { if let Some(correct) = rule.correct_for_drops && rule.blocks.contains(registry_block) diff --git a/azalea-entity/src/plugin/mod.rs b/azalea-entity/src/plugin/mod.rs index bedb03b0..6035f674 100644 --- a/azalea-entity/src/plugin/mod.rs +++ b/azalea-entity/src/plugin/mod.rs @@ -144,7 +144,7 @@ pub fn update_on_climbable( let block_pos = BlockPos::from(position); let block_state_at_feet = world.get_block_state(block_pos).unwrap_or_default(); let block_at_feet = Box::::from(block_state_at_feet); - let registry_block_at_feet = block_at_feet.as_registry_block(); + let registry_block_at_feet = block_at_feet.as_block_kind(); **on_climbable = tags::blocks::CLIMBABLE.contains(®istry_block_at_feet) || (tags::blocks::TRAPDOORS.contains(®istry_block_at_feet) @@ -167,7 +167,7 @@ fn is_trapdoor_usable_as_ladder( // block below must be a ladder let block_below = world.get_block_state(block_pos.down(1)).unwrap_or_default(); - let registry_block_below = Box::::from(block_below).as_registry_block(); + let registry_block_below = block_below.as_block_kind(); if registry_block_below != BlockKind::Ladder { return false; } -- cgit v1.2.3