// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.builtin.portals.utils.posqueries.generators;

import java.util.stream.IntStream;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import com.hypixel.hytale.builtin.portals.utils.posqueries.SpatialQueryDebug;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.builtin.portals.utils.posqueries.SpatialQuery;

public class SearchBelow implements SpatialQuery
{
    private final int height;
    
    public SearchBelow(final int height) {
        this.height = height;
    }
    
    @Override
    public Stream<Vector3d> createCandidates(final World world, final Vector3d origin, @Nullable final SpatialQueryDebug debug) {
        if (debug != null) {
            debug.appendLine("Searching up to " + this.height + " blocks below " + debug.fmt(origin));
        }
        return IntStream.rangeClosed(0, this.height).mapToObj(dy -> origin.clone().add(0.0, -dy, 0.0));
    }
}
