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 dem, final Direction fz, final BlockPos fu) {
        return new BlockHitResult(true, dem, fz, fu, false);
    }
    
    public BlockHitResult(final Vec3 dem, final Direction fz, final BlockPos fu, final boolean boolean4) {
        this(false, dem, fz, fu, boolean4);
    }
    
    private BlockHitResult(final boolean boolean1, final Vec3 dem, final Direction fz, final BlockPos fu, final boolean boolean5) {
        super(dem);
        this.miss = boolean1;
        this.direction = fz;
        this.blockPos = fu;
        this.inside = boolean5;
    }
    
    public BlockHitResult withDirection(final Direction fz) {
        return new BlockHitResult(this.miss, this.location, fz, this.blockPos, this.inside);
    }
    
    public BlockHitResult withPosition(final BlockPos fu) {
        return new BlockHitResult(this.miss, this.location, this.direction, fu, 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;
    }
}
