package net.minecraft.world.level.biome;

import com.google.common.collect.Sets;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import java.util.Random;
import java.util.List;
import java.util.Set;
import com.google.common.collect.ImmutableSet;

public class FixedBiomeSource extends BiomeSource {
    private final Biome biome;
    
    public FixedBiomeSource(final FixedBiomeSourceSettings blv) {
        super(ImmutableSet.<Biome>of(blv.getBiome()));
        this.biome = blv.getBiome();
    }
    
    @Override
    public Biome getNoiseBiome(final int integer1, final int integer2, final int integer3) {
        return this.biome;
    }
    
    @Nullable
    @Override
    public BlockPos findBiomeHorizontal(final int integer1, final int integer2, final int integer3, final int integer4, final List<Biome> list, final Random random) {
        if (list.contains(this.biome)) {
            return new BlockPos(integer1 - integer4 + random.nextInt(integer4 * 2 + 1), integer2, integer3 - integer4 + random.nextInt(integer4 * 2 + 1));
        }
        return null;
    }
    
    @Override
    public Set<Biome> getBiomesWithin(final int integer1, final int integer2, final int integer3, final int integer4) {
        return Sets.<Biome>newHashSet(this.biome);
    }
}
