@@ -2,7 +2,8 @@ use anyhow::Result;
22use azalea:: {
33 app:: { App , Plugin , Update } ,
44 ecs:: prelude:: * ,
5- interact:: BlockInteractEvent ,
5+ interact:: StartUseItemEvent ,
6+ protocol:: packets:: game:: s_interact:: InteractionHand ,
67 BlockPos ,
78} ;
89
@@ -36,7 +37,7 @@ impl InteractCommandPlugin {
3637 pub fn handle_interact_cmd_events (
3738 mut cmd_events : EventReader < CmdEvent > ,
3839 mut msg_events : EventWriter < MsgEvent > ,
39- mut block_interact_events : EventWriter < BlockInteractEvent > ,
40+ mut block_interact_events : EventWriter < StartUseItemEvent > ,
4041 ) {
4142 for event in cmd_events. read ( ) . cloned ( ) {
4243 let ( Cmds :: Interact ( _plugin) , Some ( entity) ) = ( event. cmd , event. entity ) else {
@@ -70,7 +71,11 @@ impl InteractCommandPlugin {
7071 return ;
7172 } ;
7273
73- block_interact_events. write ( BlockInteractEvent { entity, position } ) ;
74+ block_interact_events. write ( StartUseItemEvent {
75+ entity,
76+ hand : InteractionHand :: MainHand ,
77+ force_block : Some ( position) ,
78+ } ) ;
7479 msg_events. write ( msg_event) ;
7580 }
7681
0 commit comments