Java Code Examples for net.minecraft.world.biome.BiomeGenBase#desertHills()

The following examples show how to use net.minecraft.world.biome.BiomeGenBase#desertHills() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChunkProviderRoss128b.java    From bartworks with MIT License 4 votes vote down vote up
@Override
public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {
    BlockFalling.fallInstantly = true;
    int k = p_73153_2_ * 16;
    int l = p_73153_3_ * 16;
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
    this.rand.setSeed(this.worldObj.getSeed());
    if (p_73153_2_ % 4 == 0 || p_73153_3_ % 4 == 0) {
        long i1 = this.rand.nextLong() / 2L * 2L + 1L;
        long j1 = this.rand.nextLong() / 2L * 2L + 1L;
        this.rand.setSeed((long) p_73153_2_ * i1 + (long) p_73153_3_ * j1 ^ this.worldObj.getSeed());
    }

    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));

    int x1;
    int y1;
    int z1;
    if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, LAKE)) {
        x1 = k + this.rand.nextInt(16) + 8;
        y1 = this.rand.nextInt(256);
        z1 = l + this.rand.nextInt(16) + 8;
        int rni = this.rand.nextInt(8);
        if (rni == 0)
            (new WorldGenLakes(Blocks.ice)).generate(this.worldObj, this.rand, x1, y1, z1);
        else if (rni == 4)
            (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, x1, y1, z1);
    }
    if (biomegenbase != BiomeGenBase.ocean && biomegenbase != BiomeGenBase.deepOcean && biomegenbase != BiomeGenBase.river && biomegenbase != BiomeGenBase.frozenOcean && biomegenbase != BiomeGenBase.frozenRiver
            && this.rand.nextInt(ConfigHandler.ross128bRuinChance) == 0) {
        x1 = k + this.rand.nextInt(16) + 3;
        y1 = this.rand.nextInt(256);
        z1 = l + this.rand.nextInt(16) + 3;
        this.ruinsBase.generate(this.worldObj, this.rand, x1, y1, z1);
    }

    biomegenbase.decorate(this.worldObj, this.rand, k, l);

    k += 8;
    l += 8;

    boolean doGen = TerrainGen.populate(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false, ICE);
    for (x1 = 0; doGen && x1 < 16; ++x1) {
        for (y1 = 0; y1 < 16; ++y1) {
            z1 = this.worldObj.getPrecipitationHeight(k + x1, l + y1);

            if (this.worldObj.isBlockFreezable(x1 + k, z1 - 1, y1 + l)) {
                this.worldObj.setBlock(x1 + k, z1 - 1, y1 + l, Blocks.ice, 0, 2);
            }

            if (this.worldObj.func_147478_e(x1 + k, z1, y1 + l, true)) {
                this.worldObj.setBlock(x1 + k, z1, y1 + l, Blocks.snow_layer, 0, 2);
            }
        }
    }

    BWOreGen.generate(this.rand, p_73153_2_, p_73153_3_, this.worldObj, this, this);
    MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, this.worldObj, this.rand, p_73153_2_, p_73153_3_, false));

    BlockFalling.fallInstantly = false;
}