Skip to content

Commit

Permalink
made AOE break behaviour not work while sneaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 27, 2023
1 parent cc2a757 commit 13a042f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ public InteractionResultHolder<ItemStack> onRightClick(IAntimatterTool instance,
@Override
public boolean onBlockDestroyed(IAntimatterTool instance, ItemStack stack, Level world, BlockState state, BlockPos pos, LivingEntity entity) {
//if(!super.onBlockDestroyed(stack, world, state, pos, entity)) return false;
if (!(entity instanceof Player)) return true;
if (!(entity instanceof Player player)) return true;
CompoundTag tag = instance.getDataTag(stack);
if (tag == null || !tag.getBoolean(Ref.KEY_TOOL_BEHAVIOUR_AOE_BREAK)) return true;
Player player = (Player) entity;
if (tag == null || !tag.getBoolean(Ref.KEY_TOOL_BEHAVIOUR_AOE_BREAK) || player.isCrouching() || player.getLevel().isClientSide) return true;
for (BlockPos blockPos : Utils.getHarvestableBlocksToBreak(world, player, instance, stack, column, row, depth)) {
if (!instance.hasEnoughDurability(stack, instance.getAntimatterToolType().getUseDurability(), instance.getAntimatterToolType().isPowered()))
return true;
Expand Down

0 comments on commit 13a042f

Please sign in to comment.