package net.minecraft.world.level.block;

import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.core.Direction;
import java.util.Random;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;

public class CryingObsidianBlock extends Block {
    public CryingObsidianBlock(final Properties c) {
        super(c);
    }
    
    @Override
    public void animateTick(final BlockState cfj, final Level bqb, final BlockPos fu, final Random random) {
        if (random.nextInt(5) != 0) {
            return;
        }
        final Direction fz6 = Direction.getRandom(random);
        if (fz6 == Direction.UP) {
            return;
        }
        final BlockPos fu2 = fu.relative(fz6);
        final BlockState cfj2 = bqb.getBlockState(fu2);
        if (cfj.canOcclude() && cfj2.isFaceSturdy(bqb, fu2, fz6.getOpposite())) {
            return;
        }
        final double double9 = (fz6.getStepX() == 0) ? random.nextDouble() : (0.5 + fz6.getStepX() * 0.6);
        final double double10 = (fz6.getStepY() == 0) ? random.nextDouble() : (0.5 + fz6.getStepY() * 0.6);
        final double double11 = (fz6.getStepZ() == 0) ? random.nextDouble() : (0.5 + fz6.getStepZ() * 0.6);
        bqb.addParticle(ParticleTypes.DRIPPING_OBSIDIAN_TEAR, fu.getX() + double9, fu.getY() + double10, fu.getZ() + double11, 0.0, 0.0, 0.0);
    }
}
