src/main/java/com/github/klikli_dev/occultism/util/Math3DUtil.java
/**
     * Gets all blocks in the given direction and distance, sorted by distance from closest to furthest.
     * Does not stop on hit!
     *
     * @param start     the start position
     * @param direction the trace direction
     * @param distance  the trace distance
     * @return a list of block positions
     */
Gets all blocks in the given direction and distance, sorted by distance from closest to furthest.
Does not stop on hit!

@param start     the start position
@param direction the trace direction
@param distance  the trace distance
@return a list of block positions
Gets all blocks in the given direction and distance sorted by distance from closest to furthest . Does not stop on hit! @param start the start position @param direction the trace direction @param distance the trace distance @return a list of block positions
public static List<BlockPos> simpleTrace(BlockPos start, Direction direction, int distance) {
        return BlockPos.betweenClosedStream(start, start.relative(direction, distance)).map(BlockPos::immutable)
                .sorted(Comparator.comparingDouble(start::distSqr)).collect(Collectors.toList());
    }
public static List < BlockPos > simpleTrace ( BlockPos start , Direction direction , int distance ) { return BlockPos . betweenClosedStream ( start , start . relative ( direction , distance ) ) . map ( BlockPos :: immutable ) . sorted ( Comparator . comparingDouble ( start :: distSqr ) ) . collect ( Collectors . toList ( ) ) ; }
Gets all blocks in the given direction and distance, sorted by distance from closest to furthest.
Gets all blocks in the given direction and distance sorted by distance from closest to furthest .
//map to a new block pos because getAllInBox uses a mutable blockpos internally for iteration, // leading to the same block being collected 6x when not mapping it to an immutable blockpos