package net.minecraft.world.level.biome;

import java.util.Set;
import com.google.common.collect.ImmutableSet;

public class CheckerboardColumnBiomeSource extends BiomeSource {
    private final Biome[] allowedBiomes;
    private final int bitShift;
    
    public CheckerboardColumnBiomeSource(final CheckerboardBiomeSourceSettings bld) {
        super(ImmutableSet.<Biome>copyOf(bld.getAllowedBiomes()));
        this.allowedBiomes = bld.getAllowedBiomes();
        this.bitShift = bld.getSize() + 2;
    }
    
    @Override
    public Biome getNoiseBiome(final int integer1, final int integer2, final int integer3) {
        return this.allowedBiomes[Math.abs(((integer1 >> this.bitShift) + (integer3 >> this.bitShift)) % this.allowedBiomes.length)];
    }
}
