@@ -141,8 +141,9 @@ private void postControlPanel(PlayerInteractEvent e) {
141141 MsgUtil .sendControlPanelInfo (p , Objects .requireNonNull (plugin .getShopManager ().getShop (block .getLocation ())));
142142 this .playClickSound (e .getPlayer ());
143143 Objects .requireNonNull (plugin .getShopManager ().getShop (block .getLocation ())).setSignText ();
144+ //Prevent use item by ancient
144145 if (e .getAction () == Action .RIGHT_CLICK_BLOCK ) {
145- e .setCancelled ( true );
146+ e .setUseItemInHand ( Event . Result . DENY );
146147 }
147148 }
148149 }
@@ -188,7 +189,8 @@ private void postTrade(PlayerInteractEvent e) {
188189 if (!InteractUtil .check (InteractUtil .Action .TRADE , p .isSneaking ())) {
189190 return ;
190191 }
191- e .setCancelled (true );
192+ //Prevent use item by ancient
193+ e .setUseItemInHand (Event .Result .DENY );
192194 shop .onClick ();
193195 this .playClickSound (e .getPlayer ());
194196 // Text menu
@@ -282,8 +284,9 @@ else if (e.useInteractedBlock() == Event.Result.ALLOW
282284 final SimpleInfo info = new SimpleInfo (b .getLocation (), ShopAction .CREATE , e .getItem (), last , false );
283285 plugin .getShopManager ().getActions ().put (p .getUniqueId (), info );
284286 plugin .text ().of (p , "how-much-to-trade-for" , MsgUtil .getTranslateText (Objects .requireNonNull (e .getItem ())), Integer .toString (plugin .isAllowStack () && QuickShop .getPermissionManager ().hasPermission (p , "quickshop.create.stacks" ) ? item .getAmount () : 1 )).send ();
287+ //Prevent use item by ancient
285288 if (e .getAction () == Action .RIGHT_CLICK_BLOCK ) {
286- e .setCancelled ( true );
289+ e .setUseItemInHand ( Event . Result . DENY );
287290 }
288291 }
289292 }
0 commit comments