You guessed it, more Nether biome stuff
This commit is contained in:
parent
6fe11a828b
commit
a2d4ac5541
7 changed files with 136 additions and 11 deletions
|
@ -30,8 +30,8 @@ public class BiomeCorruptedSands extends BOPHellBiome
|
|||
|
||||
// splatter top blocks
|
||||
IBlockPosQuery emptyNetherrack = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
||||
this.addGenerator("soulsand_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(17.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyNetherrack).with(Blocks.SOUL_SAND.getDefaultState()).create());
|
||||
this.addGenerator("soulsand_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(20.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyNetherrack).with(Blocks.SOUL_SAND.getDefaultState()).create());
|
||||
|
||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(7.0F).with(BOPPlants.THORN).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(10.0F).with(BOPPlants.THORN).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class BiomeFungiForest extends BOPHellBiome
|
|||
{
|
||||
super("fungi_forest", new PropsBuilder("Fungi Forest").withGuiColour(0xA93C3E));
|
||||
|
||||
this.addWeight(BOPClimates.HELL, 20);
|
||||
this.addWeight(BOPClimates.HELL, 15);
|
||||
|
||||
// shrooms
|
||||
IBlockPosQuery surfaceBlocks = BlockQuery.buildOr().states(this.topBlock).create();
|
||||
|
@ -58,6 +58,6 @@ public class BiomeFungiForest extends BOPHellBiome
|
|||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(5.0F).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(Blocks.RED_MUSHROOM.getDefaultState()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(2.0F).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(Blocks.BROWN_MUSHROOM.getDefaultState()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
this.addGenerator("big_brown_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(2.0F).mushroomType(GeneratorBigMushroom.BigMushroomType.BROWN).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).create());
|
||||
this.addGenerator("big_red_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(15.0F).mushroomType(GeneratorBigMushroom.BigMushroomType.RED).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).create());
|
||||
this.addGenerator("big_red_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(10.0F).mushroomType(GeneratorBigMushroom.BigMushroomType.RED).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).create());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ public class BiomePhantasmagoricInferno extends BOPHellBiome
|
|||
this.fillerBlock = BOPBlocks.ash_block.getDefaultState();
|
||||
|
||||
// lava lakes
|
||||
this.addGenerator("lava_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(2.0F).waterLakeForBiome(this).liquid(Blocks.LAVA).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
this.addGenerator("lava_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(5.0F).waterLakeForBiome(this).liquid(Blocks.LAVA).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
|
||||
// splatter top blocks
|
||||
IBlockPosQuery emptyAsh = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
||||
this.addGenerator("magma_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(4.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyAsh).with(Blocks.MAGMA.getDefaultState()).create());
|
||||
this.addGenerator("magma_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(2.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyAsh).with(Blocks.MAGMA.getDefaultState()).create());
|
||||
|
||||
this.addGenerator("fire", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(5.0F).with(Blocks.FIRE.getDefaultState()).placeOn(emptyAsh).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
}
|
||||
|
|
|
@ -9,16 +9,21 @@ package biomesoplenty.common.biome.nether;
|
|||
|
||||
import biomesoplenty.api.block.BOPBlocks;
|
||||
import biomesoplenty.api.block.IBlockPosQuery;
|
||||
import biomesoplenty.api.enums.*;
|
||||
import biomesoplenty.api.enums.BOPClimates;
|
||||
import biomesoplenty.api.enums.BOPFlowers;
|
||||
import biomesoplenty.api.enums.BOPTrees;
|
||||
import biomesoplenty.api.enums.BOPWoods;
|
||||
import biomesoplenty.api.generation.GeneratorStage;
|
||||
import biomesoplenty.common.block.BlockBOPGrass;
|
||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
||||
import biomesoplenty.common.block.BlockBOPLog;
|
||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
||||
import biomesoplenty.common.block.BlockBOPVine;
|
||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
||||
import biomesoplenty.common.util.block.BlockQuery;
|
||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
||||
import biomesoplenty.common.world.generator.GeneratorVines;
|
||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
@ -33,13 +38,16 @@ public class BiomeUndergarden extends BOPHellBiome
|
|||
{
|
||||
super("undergarden", new PropsBuilder("Undergarden").withGuiColour(0xA93C3E));
|
||||
|
||||
this.addWeight(BOPClimates.HELL, 20);
|
||||
this.addWeight(BOPClimates.HELL, 15);
|
||||
|
||||
// splatter top blocks
|
||||
IBlockPosQuery emptyNetherrack = BlockQuery.buildAnd().states(this.topBlock).withAirAbove().create();
|
||||
IBlockState overgrownNetherrack = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_NETHERRACK);
|
||||
this.addGenerator("overgrown_netherrack_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(15.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyNetherrack).with(overgrownNetherrack).create());
|
||||
this.addGenerator("overgrown_netherrack_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(20.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyNetherrack).with(overgrownNetherrack).create());
|
||||
|
||||
IBlockPosQuery suitableNetherrackPosition = BlockQuery.buildAnd().withAltitudeBetween(80, 130).blocks(Blocks.NETHERRACK).create();
|
||||
this.addGenerator("ivy", GeneratorStage.FLOWERS,(new GeneratorVines.Builder()).amountPerChunk(30.0F).generationAttempts(32).placeOn(suitableNetherrackPosition).with(BOPBlocks.ivy.getDefaultState().withProperty(BlockBOPVine.UP, Boolean.valueOf(true)).withProperty(BlockBOPVine.EAST, Boolean.valueOf(true)).withProperty(BlockBOPVine.WEST, Boolean.valueOf(true)).withProperty(BlockBOPVine.SOUTH, Boolean.valueOf(true)).withProperty(BlockBOPVine.NORTH, Boolean.valueOf(true))).minHeight(8).maxHeight(20).create());
|
||||
|
||||
// flowers
|
||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.0F);
|
||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
||||
|
@ -47,7 +55,7 @@ public class BiomeUndergarden extends BOPHellBiome
|
|||
|
||||
// trees
|
||||
IBlockPosQuery surfaceBlocks = BlockQuery.buildOr().states(this.topBlock, overgrownNetherrack).create();
|
||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(9.0F);
|
||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(12.0F);
|
||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
||||
treeGenerator.add("twiglet", 3, (new GeneratorTwigletTree.Builder()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).minHeight(2).maxHeight(2).log(BlockBOPLog.paging.getVariantState(BOPWoods.HELLBARK)).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.HELLBARK)).create());
|
||||
|
||||
|
|
|
@ -57,6 +57,6 @@ public class BiomeVisceralHeap extends BOPHellBiome
|
|||
// blood pools
|
||||
this.addGenerator("blood_pools", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.0F).waterLakeForBiome(this).liquid(BOPBlocks.blood).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
||||
|
||||
this.addGenerator("eyebulbs", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(1.0F).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BlockBOPDoublePlant.DoublePlantType.EYEBULB).create());
|
||||
this.addGenerator("eyebulbs", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.7F).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BlockBOPDoublePlant.DoublePlantType.EYEBULB).create());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|||
import biomesoplenty.common.world.generator.GeneratorSpike;
|
||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
||||
import biomesoplenty.common.world.generator.GeneratorSplotches;
|
||||
import biomesoplenty.common.world.generator.GeneratorVines;
|
||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
||||
|
@ -74,6 +75,7 @@ public class ModGenerators
|
|||
registerGenerator("blobs", GeneratorBlobs.class, new GeneratorBlobs.Builder());
|
||||
registerGenerator("lakes", GeneratorLakes.class, new GeneratorLakes.Builder());
|
||||
registerGenerator("columns", GeneratorColumns.class, new GeneratorColumns.Builder());
|
||||
registerGenerator("vines", GeneratorVines.class, new GeneratorVines.Builder());
|
||||
registerGenerator("mixed_lily", GeneratorMixedLily.class, new GeneratorMixedLily.Builder());
|
||||
registerGenerator("crystals", GeneratorCrystals.class, new GeneratorCrystals.Builder());
|
||||
registerGenerator("spike", GeneratorSpike.class, new GeneratorSpike.Builder());
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 2015-2016, the Biomes O' Plenty Team
|
||||
*
|
||||
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
|
||||
*
|
||||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
|
||||
******************************************************************************/
|
||||
|
||||
package biomesoplenty.common.world.generator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import biomesoplenty.api.block.BlockQueries;
|
||||
import biomesoplenty.api.block.IBlockPosQuery;
|
||||
import biomesoplenty.api.config.IConfigObj;
|
||||
import biomesoplenty.common.util.biome.GeneratorUtils;
|
||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
||||
import biomesoplenty.common.util.block.BlockQuery.BlockQueryMaterial;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GeneratorVines extends GeneratorReplacing
|
||||
{
|
||||
|
||||
public static class Builder extends GeneratorReplacing.InnerBuilder<Builder, GeneratorVines> implements IGeneratorBuilder<GeneratorVines>
|
||||
{
|
||||
protected int minHeight;
|
||||
protected int maxHeight;
|
||||
protected int generationAttempts;
|
||||
|
||||
public Builder minHeight(int a) {this.minHeight = a; return this.self();}
|
||||
public Builder maxHeight(int a) {this.maxHeight = a; return this.self();}
|
||||
public Builder generationAttempts(int a) {this.generationAttempts = a; return this.self();}
|
||||
|
||||
public Builder()
|
||||
{
|
||||
// defaults
|
||||
this.amountPerChunk = 1.0F;
|
||||
this.placeOn = new BlockQueryMaterial(Material.GROUND, Material.GRASS);
|
||||
this.replace = BlockQueries.airOrLeaves;
|
||||
this.with = Blocks.COBBLESTONE.getDefaultState();
|
||||
this.scatterYMethod = ScatterYMethod.AT_SURFACE;
|
||||
this.minHeight = 2;
|
||||
this.maxHeight = 4;
|
||||
this.generationAttempts = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratorVines create()
|
||||
{
|
||||
return new GeneratorVines(this.amountPerChunk, this.placeOn, this.replace, this.with, this.scatterYMethod, this.minHeight, this.maxHeight, this.generationAttempts);
|
||||
}
|
||||
}
|
||||
|
||||
protected int minHeight;
|
||||
protected int maxHeight;
|
||||
protected int generationAttempts;
|
||||
protected boolean randomDirection;
|
||||
|
||||
public GeneratorVines(float amountPerChunk, IBlockPosQuery placeOn, IBlockPosQuery replace, IBlockState with, ScatterYMethod scatterYMethod, int minHeight, int maxHeight, int generationAttempts)
|
||||
{
|
||||
super(amountPerChunk, placeOn, replace, with, scatterYMethod);
|
||||
this.minHeight = minHeight;
|
||||
this.maxHeight = maxHeight;
|
||||
this.generationAttempts = generationAttempts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(World world, Random rand, BlockPos pos)
|
||||
{
|
||||
for (int i = 0; i < this.generationAttempts; ++i)
|
||||
{
|
||||
BlockPos genPos = pos.add(rand.nextInt(4) - rand.nextInt(4), rand.nextInt(3) - rand.nextInt(3), rand.nextInt(4) - rand.nextInt(4));
|
||||
|
||||
|
||||
// see if we can place the column
|
||||
if (this.placeOn.matches(world, genPos.up()) && this.replace.matches(world, genPos))
|
||||
{
|
||||
// choose random target height
|
||||
int targetHeight = GeneratorUtils.nextIntBetween(rand, this.minHeight, this.maxHeight);
|
||||
|
||||
// keep placing blocks upwards (if there's room)
|
||||
for (int height = 0; height <= targetHeight && replace.matches(world, genPos); height++)
|
||||
{
|
||||
if (this.with.getBlock().canPlaceBlockAt(world, genPos))
|
||||
{
|
||||
world.setBlockState(genPos, this.with);
|
||||
genPos = genPos.down();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(IConfigObj conf)
|
||||
{
|
||||
this.amountPerChunk = conf.getFloat("amountPerChunk", this.amountPerChunk);
|
||||
this.with = conf.getBlockState("with", this.with);
|
||||
this.minHeight = conf.getInt("minHeight", this.minHeight);
|
||||
this.maxHeight = conf.getInt("maxHeight", this.maxHeight);
|
||||
this.generationAttempts = conf.getInt("generationAttempts", this.generationAttempts);
|
||||
this.placeOn = conf.getBlockPosQuery("placeOn", this.placeOn);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue