src/main/java/com/github/klikli_dev/occultism/util/Math3DUtil.java
/**
     * Gets the first blockPos fulfilling the hit condition in the given direction and distance.
     *
     * @param start        the start position
     * @param direction    the trace direction
     * @param distance     the trace distance
     * @param hitCondition the hit condition.
     * @return the hit block pos, or null if no hit.
     */
Gets the first blockPos fulfilling the hit condition in the given direction and distance.
@param start        the start position
@param direction    the trace direction
@param distance     the trace distance
@param hitCondition the hit condition.
@return the hit block pos, or null if no hit.
Gets the first blockPos fulfilling the hit condition in the given direction and distance . @param start the start position @param direction the trace direction @param distance the trace distance @param hitCondition the hit condition . @return the hit block pos or null if no hit .
public static BlockPos simpleTrace(BlockPos start, Direction direction, int distance,
                                       Predicate<BlockPos> hitCondition) {
        List<BlockPos> positions = simpleTrace(start, direction, distance);
        for (BlockPos pos : positions)
            if (hitCondition.test(pos))
                return pos;
        return null;
    }
public static BlockPos simpleTrace ( BlockPos start , Direction direction , int distance , Predicate < BlockPos > hitCondition ) { List < BlockPos > positions = simpleTrace ( start , direction , distance ) ; for ( BlockPos pos : positions ) if ( hitCondition . test ( pos ) ) return pos ; return null ; }
Gets the first blockPos fulfilling the hit condition in the given direction and distance.
Gets the first blockPos fulfilling the hit condition in the given direction and distance .