Search in sources :

Example 36 with Biome

use of net.minecraft.world.biome.Biome in project MorePlanets by SteveKunG.

the class MapGenChalosRavine method digBlock.

protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) {
    Biome biome = this.world.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState state = data.getBlockState(x, y, z);
    IBlockState top = biome.topBlock;
    IBlockState filler = biome.fillerBlock;
    if (state.getBlock() == ChalosBlocks.CHALOS_BLOCK || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) {
        if (y < 10) {
            data.setBlockState(x, y, z, Blocks.LAVA.getDefaultState());
        } else {
            data.setBlockState(x, y, z, Blocks.AIR.getDefaultState());
            if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) {
                data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState());
            }
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome) IBlockState(net.minecraft.block.state.IBlockState) BlockPos(net.minecraft.util.math.BlockPos)

Example 37 with Biome

use of net.minecraft.world.biome.Biome in project MorePlanets by SteveKunG.

the class MapGenNibiruRavine method digBlock.

protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) {
    Biome biome = this.world.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState state = data.getBlockState(x, y, z);
    IBlockState top = this.isExceptionBiome(biome) ? NibiruBlocks.INFECTED_GRASS.getDefaultState() : biome.topBlock;
    IBlockState filler = this.isExceptionBiome(biome) ? NibiruBlocks.INFECTED_DIRT.getDefaultState() : biome.fillerBlock;
    if (state.getBlock() == NibiruBlocks.NIBIRU_BLOCK || state.getBlock() == NibiruBlocks.NIBIRU_ORE || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) {
        if (y < 10) {
            data.setBlockState(x, y, z, Blocks.LAVA.getDefaultState());
        } else {
            data.setBlockState(x, y, z, Blocks.AIR.getDefaultState());
            if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) {
                data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState());
            }
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome) IBlockState(net.minecraft.block.state.IBlockState) BlockPos(net.minecraft.util.math.BlockPos)

Example 38 with Biome

use of net.minecraft.world.biome.Biome in project MorePlanets by SteveKunG.

the class ChunkGeneratorNibiru method replaceBlocksForBiome.

public void replaceBlocksForBiome(int chunkX, int chunkZ, ChunkPrimer chunkPrimer, Biome[] biome) {
    double d0 = 0.03125D;
    this.depthBuffer = this.surfaceNoise.getRegion(this.depthBuffer, chunkX * 16, chunkZ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D);
    for (int i = 0; i < 16; ++i) {
        for (int j = 0; j < 16; ++j) {
            Biome biomegenbase = biome[j + i * 16];
            biomegenbase.genTerrainBlocks(this.worldObj, this.rand, chunkPrimer, chunkX * 16 + i, chunkZ * 16 + j, this.depthBuffer[j + i * 16]);
        }
    }
}
Also used : Biome(net.minecraft.world.biome.Biome)

Example 39 with Biome

use of net.minecraft.world.biome.Biome in project MorePlanets by SteveKunG.

the class MapGenNibiruCaves method isTopBlock.

private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) {
    Biome biome = this.world.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState state = data.getBlockState(x, y, z);
    return this.isExceptionBiome(biome) ? state.getBlock() == NibiruBlocks.INFECTED_GRASS : state.getBlock() == biome.topBlock;
}
Also used : Biome(net.minecraft.world.biome.Biome) IBlockState(net.minecraft.block.state.IBlockState) BlockPos(net.minecraft.util.math.BlockPos)

Example 40 with Biome

use of net.minecraft.world.biome.Biome in project MorePlanets by SteveKunG.

the class MapGenNibiruRavine method isTopBlock.

private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) {
    Biome biome = this.world.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
    IBlockState state = data.getBlockState(x, y, z);
    return this.isExceptionBiome(biome) ? state.getBlock() == NibiruBlocks.INFECTED_GRASS : state.getBlock() == biome.topBlock;
}
Also used : Biome(net.minecraft.world.biome.Biome) IBlockState(net.minecraft.block.state.IBlockState) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

Biome (net.minecraft.world.biome.Biome)110 BlockPos (net.minecraft.util.math.BlockPos)39 IBlockState (net.minecraft.block.state.IBlockState)16 ResourceLocation (net.minecraft.util.ResourceLocation)9 World (net.minecraft.world.World)9 Nullable (javax.annotation.Nullable)8 Random (java.util.Random)7 ChunkPos (net.minecraft.util.math.ChunkPos)7 DoubleRange (com.almuradev.toolbox.util.math.DoubleRange)6 HashMap (java.util.HashMap)6 FunctionPredicate (com.almuradev.content.component.predicate.FunctionPredicate)5 Map (java.util.Map)5 Block (net.minecraft.block.Block)5 WorldServer (net.minecraft.world.WorldServer)5 BiomeChunk (com.almuradev.almura.feature.biome.BiomeChunk)4 Overwrite (org.spongepowered.asm.mixin.Overwrite)4 Entity (net.minecraft.entity.Entity)3 IntRange (com.almuradev.toolbox.util.math.IntRange)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2