package net.minecraft.world.phys;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;

public class BlockHitResult extends HitResult {
    private final Direction direction;
    private final BlockPos blockPos;
    private final boolean miss;
    private final boolean inside;
    
    public static BlockHitResult miss(final Vec3 cvl, final Direction fp, final BlockPos fk) {
        return new BlockHitResult(true, cvl, fp, fk, false);
    }
    
    public BlockHitResult(final Vec3 cvl, final Direction fp, final BlockPos fk, final boolean boolean4) {
        this(false, cvl, fp, fk, boolean4);
    }
    
    private BlockHitResult(final boolean boolean1, final Vec3 cvl, final Direction fp, final BlockPos fk, final boolean boolean5) {
        super(cvl);
        this.miss = boolean1;
        this.direction = fp;
        this.blockPos = fk;
        this.inside = boolean5;
    }
    
    public BlockHitResult withDirection(final Direction fp) {
        return new BlockHitResult(this.miss, this.location, fp, this.blockPos, this.inside);
    }
    
    public BlockPos getBlockPos() {
        return this.blockPos;
    }
    
    public Direction getDirection() {
        return this.direction;
    }
    
    @Override
    public Type getType() {
        return this.miss ? Type.MISS : Type.BLOCK;
    }
    
    public boolean isInside() {
        return this.inside;
    }
}
