From c36201cc894bcc99a06358eea31d210800980dae Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 28 Nov 2024 03:17:58 +0000 Subject: change DataComponentPatch::get to take in a generic (and add get_kind, has, and has_kind) --- azalea-client/src/interact.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'azalea-client/src') diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index d2dfd93a..0acc6992 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -10,14 +10,13 @@ use azalea_core::{ use azalea_entity::{ clamp_look_direction, view_vector, Attributes, EyeHeight, LocalEntity, LookDirection, Position, }; -use azalea_inventory::{ItemStack, ItemStackData}; +use azalea_inventory::{components, ItemStack, ItemStackData}; use azalea_physics::clip::{BlockShapeType, ClipContext, FluidPickType}; use azalea_protocol::packets::game::{ s_interact::InteractionHand, s_swing::ServerboundSwing, s_use_item_on::{BlockHit, ServerboundUseItemOn}, }; -use azalea_registry::DataComponentKind; use azalea_world::{Instance, InstanceContainer, InstanceName}; use bevy_app::{App, Plugin, Update}; use bevy_ecs::{ @@ -268,7 +267,7 @@ pub fn check_block_can_be_broken_by_item_in_adventure_mode( // minecraft caches the last checked block but that's kind of an unnecessary // optimization and makes the code too complicated - let Some(_can_destroy) = item.components.get(DataComponentKind::CanBreak) else { + if !item.components.has::() { // no CanDestroy tag return false; }; -- cgit v1.2.3