Finally stop those damn floating paeonias

This commit is contained in:
Cheeserolls 2015-06-07 17:20:29 +01:00
parent cfc3cd65ff
commit 3256dd9447
3 changed files with 23 additions and 5 deletions

View file

@ -53,10 +53,8 @@ public class BiomeGenMarsh extends BOPBiome
this.spawnableWaterCreatureList.clear();
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
// lakes (it might seem obvious that lakes should be done at GeneratorStage.WATER_LAKES, but that is actually executed very late, after all plants and flowers
// TODO: find a way to make the lakes shallower
// TODO: put splotches of mud on the bottom? Either using a new GeneratorSplotches or perhaps by adding a lake parameter
// this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.5F).waterLakeForBiome(this).create());
// mud
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(8).maxRadius(7).with(BOPBlocks.mud.getDefaultState().withProperty(BlockMud.VARIANT, BlockMud.MudType.MUD)).create());
@ -79,8 +77,8 @@ public class BiomeGenMarsh extends BOPBiome
// gem
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
}
}

View file

@ -24,6 +24,7 @@ import biomesoplenty.common.util.block.BlockQueryUtils.BlockQueryState;
import biomesoplenty.common.util.block.BlockQueryUtils.IBlockPosQuery;
import biomesoplenty.common.util.config.BOPConfig.IConfigObj;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -101,7 +102,16 @@ public class GeneratorDoubleFlora extends BOPGeneratorBase
if (this.replace.matches(world, genPos) && this.replace.matches(world, genPos.up()) && genPos.getY() < 254)
{
boolean canStay = bottomBlock instanceof BlockDecoration ? ((BlockDecoration)bottomBlock).canBlockStay(world, genPos, this.bottomState) : bottomBlock.canPlaceBlockAt(world, genPos);
boolean canStay;
if (bottomBlock instanceof BlockDecoration)
{
canStay = ((BlockDecoration)bottomBlock).canBlockStay(world, genPos, this.bottomState);
} else if (bottomBlock instanceof BlockBush) {
canStay = ((BlockBush)bottomBlock).canPlaceBlockAt(world, genPos);
} else {
canStay = bottomBlock.canPlaceBlockAt(world, genPos);
}
if (canStay)
{
world.setBlockState(genPos, this.bottomState, 2);

View file

@ -11,6 +11,7 @@ package biomesoplenty.common.world.feature;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
@ -97,7 +98,16 @@ public class GeneratorFlora extends BOPGeneratorBase
if (this.replace.matches(world, genPos) && genPos.getY() < 255)
{
boolean canStay = block instanceof BlockDecoration ? ((BlockDecoration)block).canBlockStay(world, genPos, this.with) : block.canPlaceBlockAt(world, genPos);
boolean canStay;
if (block instanceof BlockDecoration)
{
canStay = ((BlockDecoration)block).canBlockStay(world, genPos, this.with);
} else if (block instanceof BlockBush) {
canStay = ((BlockBush)block).canPlaceBlockAt(world, genPos);
} else {
canStay = block.canPlaceBlockAt(world, genPos);
}
if (canStay)
{
world.setBlockState(genPos, this.with, 2);