aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-11-28 03:17:58 +0000
committermat <git@matdoes.dev>2024-11-28 03:17:58 +0000
commitc36201cc894bcc99a06358eea31d210800980dae (patch)
tree03cf79c6e8ee6df5e3a1c198e218bc9de7c6f119 /azalea-client/src
parent08958c2278b15ebeac8a964f392ebb792e479b61 (diff)
downloadazalea-drasl-c36201cc894bcc99a06358eea31d210800980dae.tar.xz
change DataComponentPatch::get to take in a generic (and add get_kind, has, and has_kind)
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/interact.rs5
1 files changed, 2 insertions, 3 deletions
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::<components::CanBreak>() {
// no CanDestroy tag
return false;
};