Search in sources :

Example 1 with HellMushroomPopulator

use of org.spongepowered.common.world.gen.populators.HellMushroomPopulator in project SpongeCommon by SpongePowered.

the class MixinBiomeHell method buildPopulators.

@Override
public void buildPopulators(World world, SpongeBiomeGenerationSettings gensettings) {
    RandomBlock lava1 = RandomBlock.builder().block((BlockState) Blocks.FLOWING_LAVA.getDefaultState()).perChunk(8).height(VariableAmount.baseWithRandomAddition(4, 120)).placementTarget(WorldGenConstants.HELL_LAVA).build();
    gensettings.getPopulators().add(lava1);
    NetherFire fire = NetherFire.builder().perChunk(VariableAmount.baseWithRandomAddition(1, VariableAmount.baseWithRandomAddition(1, 10))).perCluster(64).build();
    gensettings.getPopulators().add(fire);
    Glowstone glowstone1 = Glowstone.builder().blocksPerCluster(1500).clusterHeight(VariableAmount.baseWithRandomAddition(-11, 12)).perChunk(VariableAmount.baseWithRandomAddition(0, VariableAmount.baseWithRandomAddition(1, 10))).height(VariableAmount.baseWithRandomAddition(4, 120)).build();
    gensettings.getPopulators().add(glowstone1);
    Glowstone glowstone2 = Glowstone.builder().blocksPerCluster(1500).clusterHeight(VariableAmount.baseWithRandomAddition(0, 12)).perChunk(10).height(VariableAmount.baseWithRandomAddition(0, 128)).build();
    gensettings.getPopulators().add(glowstone2);
    ChanceTable<MushroomType> types = new ChanceTable<>();
    types.add(new WeightedObject<>(MushroomTypes.BROWN, 1));
    types.add(new EmptyObject<>(1));
    HellMushroomPopulator smallMushroom = new HellMushroomPopulator();
    smallMushroom.setMushroomsPerChunk(1);
    smallMushroom.getTypes().addAll(types);
    gensettings.getPopulators().add(smallMushroom);
    ChanceTable<MushroomType> types2 = new ChanceTable<>();
    types.add(new WeightedObject<>(MushroomTypes.RED, 1));
    types.add(new EmptyObject<>(1));
    HellMushroomPopulator smallMushroom2 = new HellMushroomPopulator();
    smallMushroom2.setMushroomsPerChunk(1);
    smallMushroom2.getTypes().addAll(types2);
    gensettings.getPopulators().add(smallMushroom2);
    Ore quartz = Ore.builder().height(VariableAmount.baseWithRandomAddition(10, 108)).ore(BlockTypes.QUARTZ_ORE.getDefaultState()).perChunk(16).placementCondition((o) -> o != null && o.getType() == BlockTypes.NETHERRACK).size(14).build();
    gensettings.getPopulators().add(quartz);
    int halfSeaLevel = world.getSeaLevel() / 2 + 1;
    Ore magma = Ore.builder().height(VariableAmount.baseWithRandomAddition(halfSeaLevel - 5, 10)).ore(BlockTypes.MAGMA.getDefaultState()).perChunk(4).placementCondition((o) -> o != null && o.getType() == BlockTypes.NETHERRACK).size(33).build();
    gensettings.getPopulators().add(magma);
    RandomBlock lava2 = RandomBlock.builder().block((BlockState) Blocks.FLOWING_LAVA.getDefaultState()).perChunk(16).height(VariableAmount.baseWithRandomAddition(10, 108)).placementTarget(WorldGenConstants.HELL_LAVA_ENCLOSED).build();
    gensettings.getPopulators().add(lava2);
}
Also used : RandomBlock(org.spongepowered.api.world.gen.populator.RandomBlock) Glowstone(org.spongepowered.api.world.gen.populator.Glowstone) Ore(org.spongepowered.api.world.gen.populator.Ore) ChanceTable(org.spongepowered.api.util.weighted.ChanceTable) HellMushroomPopulator(org.spongepowered.common.world.gen.populators.HellMushroomPopulator) MushroomType(org.spongepowered.api.world.gen.type.MushroomType) NetherFire(org.spongepowered.api.world.gen.populator.NetherFire)

Aggregations

ChanceTable (org.spongepowered.api.util.weighted.ChanceTable)1 Glowstone (org.spongepowered.api.world.gen.populator.Glowstone)1 NetherFire (org.spongepowered.api.world.gen.populator.NetherFire)1 Ore (org.spongepowered.api.world.gen.populator.Ore)1 RandomBlock (org.spongepowered.api.world.gen.populator.RandomBlock)1 MushroomType (org.spongepowered.api.world.gen.type.MushroomType)1 HellMushroomPopulator (org.spongepowered.common.world.gen.populators.HellMushroomPopulator)1