Search in sources :

Example 1 with WorldGenFossils

use of net.minecraft.world.gen.feature.WorldGenFossils in project RecurrentComplex by Ivorforce.

the class VanillaDecorationAdapter method generate.

@Override
public void generate(WorldServer worldIn, Random random, Biome biomeIn, BiomeDecorator decorator, BlockPos chunkPos, RCBiomeDecorator.DecorationType type) {
    RCWorldgenMonitor.start("simulating vanilla decoration");
    try {
        switch(type) {
            case TREE:
                {
                    int k6 = random.nextInt(16) + 8;
                    int l = random.nextInt(16) + 8;
                    WorldGenAbstractTree worldgenabstracttree = biomeIn.getRandomTreeFeature(random);
                    worldgenabstracttree.setDecorationDefaults();
                    BlockPos blockpos = worldIn.getHeight(chunkPos.add(k6, 0, l));
                    if (worldgenabstracttree.generate(worldIn, random, blockpos))
                        worldgenabstracttree.generateSaplings(worldIn, random, blockpos);
                    break;
                }
            case BIG_SHROOM:
                {
                    int l6 = random.nextInt(16) + 8;
                    int k10 = random.nextInt(16) + 8;
                    decorator.bigMushroomGen.generate(worldIn, random, worldIn.getHeight(chunkPos.add(l6, 0, k10)));
                    break;
                }
            case CACTUS:
                {
                    int l9 = random.nextInt(16) + 8;
                    int k13 = random.nextInt(16) + 8;
                    int l16 = worldIn.getHeight(chunkPos.add(l9, 0, k13)).getY() * 2;
                    if (l16 > 0) {
                        int j19 = random.nextInt(l16);
                        decorator.cactusGen.generate(worldIn, random, chunkPos.add(l9, j19, k13));
                    }
                    break;
                }
            case DESERT_WELL:
                {
                    int i = random.nextInt(16) + 8;
                    int j = random.nextInt(16) + 8;
                    BlockPos blockpos = worldIn.getHeight(chunkPos.add(i, 0, j)).up();
                    (new WorldGenDesertWells()).generate(worldIn, random, blockpos);
                    break;
                }
            case FOSSIL:
                {
                    (new WorldGenFossils()).generate(worldIn, random, chunkPos);
                    break;
                }
            default:
                throw new IllegalArgumentException("Unrecognized type: " + type.toString());
        }
    } catch (Exception e) {
        RecurrentComplex.logger.error("Error trying to emulate vanilla decoration", e);
    }
    RCWorldgenMonitor.stop();
}
Also used : WorldGenDesertWells(net.minecraft.world.gen.feature.WorldGenDesertWells) WorldGenAbstractTree(net.minecraft.world.gen.feature.WorldGenAbstractTree) BlockPos(net.minecraft.util.math.BlockPos) WorldGenFossils(net.minecraft.world.gen.feature.WorldGenFossils)

Example 2 with WorldGenFossils

use of net.minecraft.world.gen.feature.WorldGenFossils in project SpongeCommon by SpongePowered.

the class FossilBuilder method build.

@Override
public Fossil build() throws IllegalStateException {
    Fossil pop = (Fossil) new WorldGenFossils();
    pop.setSpawnProbability(this.probability);
    return pop;
}
Also used : Fossil(org.spongepowered.api.world.gen.populator.Fossil) WorldGenFossils(net.minecraft.world.gen.feature.WorldGenFossils)

Aggregations

WorldGenFossils (net.minecraft.world.gen.feature.WorldGenFossils)2 BlockPos (net.minecraft.util.math.BlockPos)1 WorldGenAbstractTree (net.minecraft.world.gen.feature.WorldGenAbstractTree)1 WorldGenDesertWells (net.minecraft.world.gen.feature.WorldGenDesertWells)1 Fossil (org.spongepowered.api.world.gen.populator.Fossil)1