Minor adjustments to Marsh and Chaparral

This commit is contained in:
Cheeserolls 2015-06-07 18:52:26 +01:00
parent cba8443972
commit c4e23a8384
4 changed files with 21 additions and 12 deletions

View file

@ -19,6 +19,7 @@ import biomesoplenty.api.biome.generation.GeneratorStage;
import biomesoplenty.api.biome.generation.GeneratorWeighted; import biomesoplenty.api.biome.generation.GeneratorWeighted;
import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPGems;
import biomesoplenty.common.enums.BOPPlants; import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
import biomesoplenty.common.world.feature.GeneratorDoubleFlora; import biomesoplenty.common.world.feature.GeneratorDoubleFlora;
import biomesoplenty.common.world.feature.GeneratorFlora; import biomesoplenty.common.world.feature.GeneratorFlora;
import biomesoplenty.common.world.feature.GeneratorGrass; import biomesoplenty.common.world.feature.GeneratorGrass;
@ -46,8 +47,7 @@ public class BiomeGenChaparral extends BOPBiome
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6)); this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6));
// stone patches // stone patches
// TODO: make the generator only run at the surface? this.addGenerator("stone_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(2).splotchSize(15).replace(this.topBlock).with(Blocks.stone.getDefaultState()).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
this.addGenerator("stone_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(15).replace(Blocks.grass).with(Blocks.stone.getDefaultState()).splotchSize(15).create());
// flowers // flowers
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F); GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);

View file

@ -10,6 +10,7 @@ package biomesoplenty.common.biome.overworld;
import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.BlockTallGrass; import net.minecraft.block.BlockTallGrass;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraftforge.common.BiomeManager.BiomeType; import net.minecraftforge.common.BiomeManager.BiomeType;
@ -17,15 +18,19 @@ import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.api.biome.generation.GeneratorStage; import biomesoplenty.api.biome.generation.GeneratorStage;
import biomesoplenty.api.biome.generation.GeneratorWeighted; import biomesoplenty.api.biome.generation.GeneratorWeighted;
import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.common.block.BlockBOPDirt;
import biomesoplenty.common.block.BlockBOPGrass;
import biomesoplenty.common.block.BlockBOPLilypad; import biomesoplenty.common.block.BlockBOPLilypad;
import biomesoplenty.common.block.BlockCoral; import biomesoplenty.common.block.BlockCoral;
import biomesoplenty.common.block.BlockMud; import biomesoplenty.common.block.BlockMud;
import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPGems;
import biomesoplenty.common.enums.BOPPlants; import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
import biomesoplenty.common.world.feature.GeneratorDoubleFlora; import biomesoplenty.common.world.feature.GeneratorDoubleFlora;
import biomesoplenty.common.world.feature.GeneratorFlora; import biomesoplenty.common.world.feature.GeneratorFlora;
import biomesoplenty.common.world.feature.GeneratorGrass; import biomesoplenty.common.world.feature.GeneratorGrass;
import biomesoplenty.common.world.feature.GeneratorOreSingle; import biomesoplenty.common.world.feature.GeneratorOreSingle;
import biomesoplenty.common.world.feature.GeneratorSplotches;
import biomesoplenty.common.world.feature.GeneratorWaterside; import biomesoplenty.common.world.feature.GeneratorWaterside;
public class BiomeGenMarsh extends BOPBiome public class BiomeGenMarsh extends BOPBiome
@ -36,7 +41,6 @@ public class BiomeGenMarsh extends BOPBiome
public BiomeGenMarsh() public BiomeGenMarsh()
{ {
// terrain // terrain
// TODO: the terrain seems to generate a bit higher than expected with these numbers. // TODO: the terrain seems to generate a bit higher than expected with these numbers.
this.bopMinHeight = 56; this.bopMinHeight = 56;
@ -44,6 +48,10 @@ public class BiomeGenMarsh extends BOPBiome
this.sidewaysNoiseAmount = 0.0D; this.sidewaysNoiseAmount = 0.0D;
this.setOctaveWeights(5, 5, 0, 0, 1, 1); this.setOctaveWeights(5, 5, 0, 0, 1, 1);
IBlockState mud = BOPBlocks.mud.getDefaultState().withProperty(BlockMud.VARIANT, BlockMud.MudType.MUD);
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
this.seaFloorBlock = mud;
this.setColor(0x66A06E); this.setColor(0x66A06E);
this.setTemperatureRainfall(0.5F, 0.9F); this.setTemperatureRainfall(0.5F, 0.9F);
@ -54,10 +62,10 @@ public class BiomeGenMarsh extends BOPBiome
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
// TODO: find a way to make the lakes shallower // 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
// mud // 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()); this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(8).maxRadius(7).with(mud).create());
this.addGenerator("mud_patches", GeneratorStage.SAND_PASS2, (new GeneratorSplotches.Builder()).amountPerChunk(1).splotchSize(12).replace(this.topBlock).with(mud).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
// other plants // other plants
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create()); this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create());

View file

@ -378,6 +378,7 @@ public class BlockBOPPlant extends BlockDecoration implements IShearable
// That looks bonkers to me, so I'm ignoring it for now - need to ask the others // That looks bonkers to me, so I'm ignoring it for now - need to ask the others
boolean onFertile = (adjacentBlock == Blocks.dirt || adjacentBlock == BOPBlocks.dirt || adjacentBlock == Blocks.mycelium || adjacentBlock == Blocks.grass); boolean onFertile = (adjacentBlock == Blocks.dirt || adjacentBlock == BOPBlocks.dirt || adjacentBlock == Blocks.mycelium || adjacentBlock == Blocks.grass);
boolean onMud = (adjacentBlock == BOPBlocks.mud && adjacentBlockState.getValue(BlockMud.VARIANT) == BlockMud.MudType.MUD);
boolean onDry = (adjacentBlock == BOPBlocks.hard_dirt || adjacentBlock == Blocks.hardened_clay || adjacentBlock == Blocks.sand || adjacentBlock == BOPBlocks.hard_sand || adjacentBlock == Blocks.soul_sand); boolean onDry = (adjacentBlock == BOPBlocks.hard_dirt || adjacentBlock == Blocks.hardened_clay || adjacentBlock == Blocks.sand || adjacentBlock == BOPBlocks.hard_sand || adjacentBlock == Blocks.soul_sand);
boolean onSand = (adjacentBlock == Blocks.sand || adjacentBlock == Blocks.soul_sand); boolean onSand = (adjacentBlock == Blocks.sand || adjacentBlock == Blocks.soul_sand);
boolean onGrass = (adjacentBlock == Blocks.grass); boolean onGrass = (adjacentBlock == Blocks.grass);
@ -413,7 +414,7 @@ public class BlockBOPPlant extends BlockDecoration implements IShearable
return onFertile || onSand; return onFertile || onSand;
case CATTAIL: case CATTAIL:
boolean hasWater = (world.getBlockState(pos.add(-1, -1, 0)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(1,-1,0)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(0,-1,-1)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(0,-1,1)).getBlock().getMaterial() == Material.water); boolean hasWater = (world.getBlockState(pos.add(-1, -1, 0)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(1,-1,0)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(0,-1,-1)).getBlock().getMaterial() == Material.water || world.getBlockState(pos.add(0,-1,1)).getBlock().getMaterial() == Material.water);
return onGrass && hasWater; return (onMud || onGrass) && hasWater;
case RIVERCANE: case RIVERCANE:
boolean onSelf = ( (adjacentBlock instanceof BlockBOPPlant) && ((BOPPlants) adjacentBlockState.getValue(((BlockBOPPlant)adjacentBlock).variantProperty) == BOPPlants.RIVERCANE) ); boolean onSelf = ( (adjacentBlock instanceof BlockBOPPlant) && ((BOPPlants) adjacentBlockState.getValue(((BlockBOPPlant)adjacentBlock).variantProperty) == BOPPlants.RIVERCANE) );
return onSelf || onFertile; return onSelf || onFertile;
@ -421,8 +422,9 @@ public class BlockBOPPlant extends BlockDecoration implements IShearable
return (adjacentBlock == Blocks.soul_sand); return (adjacentBlock == Blocks.soul_sand);
case REED: case REED:
// reed needs the ground block to be water, but the block below that to NOT be water // reed needs the ground block to be water, but the block below that to NOT be water
// TODO: reed is gonna have some trickiness with placing, implement as lily variation instead?
return (adjacentBlock == Blocks.water && world.getBlockState(pos.down().down()).getBlock() != Blocks.water); return (adjacentBlock == Blocks.water && world.getBlockState(pos.down().down()).getBlock() != Blocks.water);
case SHORTGRASS: case MEDIUMGRASS: case DAMPGRASS: case WILDRICE:
return onFertile || onMud;
default: default:
return onFertile; return onFertile;
} }

View file

@ -9,7 +9,6 @@
package biomesoplenty.common.block; package biomesoplenty.common.block;
import static net.minecraft.block.BlockLiquid.LEVEL; import static net.minecraft.block.BlockLiquid.LEVEL;
import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.IProperty;
@ -111,12 +110,12 @@ public class BlockCoral extends BlockDecoration
public boolean canBlockStay(World world, BlockPos pos, IBlockState state) public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{ {
Block ground = world.getBlockState(pos.down()).getBlock(); Block ground = world.getBlockState(pos.down()).getBlock();
Material groundMaterial = ground.getMaterial();
Block cover = world.getBlockState(pos.up()).getBlock(); Block cover = world.getBlockState(pos.up()).getBlock();
boolean hasWater = (cover == Blocks.water || cover == Blocks.flowing_water); boolean hasWater = (cover == Blocks.water || cover == Blocks.flowing_water);
boolean hasEarth = (ground == Blocks.dirt || ground == BOPBlocks.dirt || ground == BOPBlocks.mud || ground == Blocks.sand || ground == Blocks.sponge || ground == Blocks.stone || ground == Blocks.clay || ground == Blocks.gravel); boolean hasEarth = (groundMaterial == Material.ground || groundMaterial == Material.sand || groundMaterial == Material.clay);
return hasWater && (hasEarth || ground == Blocks.sponge);
return hasWater && hasEarth;
} }
} }