package net.minecraft.world.item;

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.Level;

public class ShearsItem extends Item {
    public ShearsItem(final Properties a) {
        super(a);
    }
    
    @Override
    public boolean mineBlock(final ItemStack ben, final Level bjw, final BlockState byj, final BlockPos fk, final LivingEntity akz) {
        if (!bjw.isClientSide) {
            ben.<LivingEntity>hurtAndBreak(1, akz, akz -> akz.broadcastBreakEvent(EquipmentSlot.MAINHAND));
        }
        final Block bph7 = byj.getBlock();
        return byj.is(BlockTags.LEAVES) || bph7 == Blocks.COBWEB || bph7 == Blocks.GRASS || bph7 == Blocks.FERN || bph7 == Blocks.DEAD_BUSH || bph7 == Blocks.VINE || bph7 == Blocks.TRIPWIRE || bph7.is(BlockTags.WOOL) || super.mineBlock(ben, bjw, byj, fk, akz);
    }
    
    @Override
    public boolean canDestroySpecial(final BlockState byj) {
        final Block bph3 = byj.getBlock();
        return bph3 == Blocks.COBWEB || bph3 == Blocks.REDSTONE_WIRE || bph3 == Blocks.TRIPWIRE;
    }
    
    @Override
    public float getDestroySpeed(final ItemStack ben, final BlockState byj) {
        final Block bph4 = byj.getBlock();
        if (bph4 == Blocks.COBWEB || byj.is(BlockTags.LEAVES)) {
            return 15.0f;
        }
        if (bph4.is(BlockTags.WOOL)) {
            return 5.0f;
        }
        return super.getDestroySpeed(ben, byj);
    }
}
