Readded the Outback biome

This commit is contained in:
Adubbz 2014-01-10 12:41:59 +11:00
parent 04ad68c0e8
commit 46a550e576
12 changed files with 269 additions and 137 deletions

View file

@ -10,7 +10,7 @@ import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBrush1;
import biomesoplenty.common.world.features.trees.WorldGenBrush2;
import biomesoplenty.common.world.features.trees.WorldGenChaparral2;
import biomesoplenty.common.world.features.trees.WorldGenMiniShrub;
public class BiomeGenBrushland extends BOPBiome
{
@ -40,7 +40,7 @@ public class BiomeGenBrushland extends BOPBiome
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return random.nextInt(2) == 0 ? new WorldGenBrush2() : (random.nextInt(5) == 0 ? new WorldGenBrush1() : new WorldGenChaparral2());
return random.nextInt(2) == 0 ? new WorldGenBrush2(Blocks.log, Blocks.leaves, 3, 0, Blocks.grass) : (random.nextInt(5) == 0 ? new WorldGenBrush1() : new WorldGenMiniShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand));
}
@Override

View file

@ -13,7 +13,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPShrub;
import biomesoplenty.common.world.features.trees.WorldGenChaparral2;
import biomesoplenty.common.world.features.trees.WorldGenMiniShrub;
import biomesoplenty.common.world.features.trees.WorldGenChaparral3;
public class BiomeGenChaparral extends BOPBiome
@ -50,7 +50,7 @@ public class BiomeGenChaparral extends BOPBiome
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return random.nextInt(2) == 0 ? new WorldGenChaparral2() : (random.nextInt(5) == 0 ? new WorldGenBOPShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand) : new WorldGenChaparral3());
return random.nextInt(2) == 0 ? new WorldGenMiniShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand) : (random.nextInt(5) == 0 ? new WorldGenBOPShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand) : new WorldGenChaparral3());
}
@Override

View file

@ -12,7 +12,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenChaparral2;
import biomesoplenty.common.world.features.trees.WorldGenMiniShrub;
import biomesoplenty.common.world.features.trees.WorldGenPoplar;
import biomesoplenty.common.world.features.trees.WorldGenPoplar2;
@ -46,7 +46,7 @@ public class BiomeGenGrove extends BOPBiome
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return random.nextInt(2) == 0 ? new WorldGenChaparral2() : random.nextInt(3) == 0 ? new WorldGenPoplar2() : new WorldGenPoplar();
return random.nextInt(2) == 0 ? new WorldGenMiniShrub(Blocks.log, Blocks.leaves, 0, 0, Blocks.grass, Blocks.sand) : random.nextInt(3) == 0 ? new WorldGenPoplar2() : new WorldGenPoplar();
}
@Override

View file

@ -1,61 +1,72 @@
package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.trees.WorldGenBOPShrub;
import biomesoplenty.common.world.features.trees.WorldGenMiniShrub;
public class BiomeGenOutback extends BOPBiome
{
private static final Height biomeHeight = new Height(0.3F, 0.4F);
public BiomeGenOutback(int par1)
public BiomeGenOutback(int id)
{
super(par1);
/*
spawnableCreatureList.clear();
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
topBlock = (byte)Blocks.hardSand.get().blockID;
fillerBlock = (byte)Blocks.hardSand.get().blockID;
customBiomeDecorator.treesPerChunk = 3;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.outbackPerChunk = 10;
customBiomeDecorator.deadBushPerChunk = 7;
customBiomeDecorator.tinyCactiPerChunk = 2;
customBiomeDecorator.cactiPerChunk = 4;
customBiomeDecorator.bushesPerChunk = 5;
customBiomeDecorator.generatePumpkins = false;
*/
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(10843716);
this.setTemperatureRainfall(0.8F, 0.05F);
this.spawnableCreatureList.clear();
this.topBlock = BOPBlockHelper.get("hardSand");
this.fillerBlock = BOPBlockHelper.get("hardSand");
this.theBiomeDecorator.treesPerChunk = 3;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.deadBushPerChunk = 7;
this.theBiomeDecorator.cactiPerChunk = 4;
this.bopWorldFeatures.grassSplatterPerChunk = 10;
this.bopWorldFeatures.tinyCactiPerChunk = 2;
this.bopWorldFeatures.bushesPerChunk = 5;
this.bopWorldFeatures.generatePumpkins = false;
}
/*
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
return random.nextInt(3) == 0 ? new WorldGenBOPShrub(Blocks.log2, Blocks.leaves2, 0, 0, BOPBlockHelper.get("hardSand")) :
new WorldGenMiniShrub(Blocks.log2, Blocks.leaves2, 0, 0, BOPBlockHelper.get("hardSand"));
}
@Override
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 2, 2);
}
}
}
*/
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{
return par1Random.nextInt(3) == 0 ? new WorldGenOutbackShrub(0,0) : new WorldGenOutbackTree();
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 2, 2);
}
}
}
*/
}

View file

@ -177,8 +177,8 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable
case 14: // Reed
return block == Blocks.water;
case 15: // Reed
return root == Blocks.grass || root == Blocks.dirt || root == Blocks.farmland || root == BOPBlockHelper.get("longGrass") || root == BOPBlockHelper.get("holyGrass") || root == BOPBlockHelper.get("holyDirt");
case 15: // Root
return root != Blocks.air && (root == Blocks.grass || root == Blocks.dirt || root == Blocks.farmland || root == BOPBlockHelper.get("longGrass") || root == BOPBlockHelper.get("holyGrass") || root == BOPBlockHelper.get("holyDirt"));
default:
return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == BOPBlockHelper.get("overgrownNetherrack");

View file

@ -40,6 +40,7 @@ import biomesoplenty.common.biomes.BiomeGenMountain;
import biomesoplenty.common.biomes.BiomeGenMysticGrove;
import biomesoplenty.common.biomes.BiomeGenOminousWoods;
import biomesoplenty.common.biomes.BiomeGenOriginValley;
import biomesoplenty.common.biomes.BiomeGenOutback;
import biomesoplenty.common.biomes.BiomeGenPasture;
import biomesoplenty.common.biomes.BiomeGenRainforest;
import biomesoplenty.common.biomes.BiomeGenSacredSprings;
@ -123,7 +124,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenOminousWoods(BOPConfigurationIDs.ominousWoodsID).setBiomeName("Ominous Woods"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenPasture(BOPConfigurationIDs.pastureID).setBiomeName("Pasture"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), BOPBiomeTemperatureType.WARM));*/

View file

@ -44,6 +44,7 @@ public class BOPWorldFeatures
public int sunflowersPerChunk = 0;
public int minersDelightPerChunk = 2;
public int rootsPerChunk = 9;
public int grassSplatterPerChunk = 0;
public int bopFlowersPerChunk = 0;
}

View file

@ -0,0 +1,79 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenGrassSplatter extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
Block block;
do
{
block = world.func_147439_a(x, y, z);
if (!(block.isLeaves(world, x, y, z) || block.isAir(world, x, y, z)))
{
break;
}
--y;
} while (y > 0);
for (int var7 = 0; var7 < 128; ++var7)
{
int randX = x + random.nextInt(8) - random.nextInt(8);
int randY = y + random.nextInt(4) - random.nextInt(4);
int randZ = z + random.nextInt(8) - random.nextInt(8);
int var999 = random.nextInt(5);
//TODO: isAirBlock()
if (world.func_147437_c(randX, randY, randZ) && (world.func_147439_a(randX, randY - 1, randZ) == BOPBlockHelper.get("hardSand") || world.func_147439_a(randX, randY - 1, randZ) == Blocks.sand || world.func_147439_a(randX, randY - 1, randZ) == Blocks.stone))
{
world.func_147465_d(randX, randY - 1, randZ, Blocks.grass, 0, 2);
if (var999 == 0)
{
world.func_147465_d(randX, randY, randZ, BOPBlockHelper.get("foliage"), 2, 2);
}
else if (var999 == 1)
{
world.func_147465_d(randX, randY, randZ, BOPBlockHelper.get("foliage"), 10, 2);
}
else if (var999 == 2)
{
world.func_147465_d(randX, randY, randZ, BOPBlockHelper.get("foliage"), 11, 2);
}
else
{
world.func_147465_d(randX, randY, randZ, BOPBlockHelper.get("foliage"), 2, 2);
}
}
}
return true;
}
@Override
public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception
{
for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++)
{
int randX = x + random.nextInt(16) + 8;
int randZ = z + random.nextInt(16) + 8;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
}

View file

@ -1,17 +1,34 @@
package biomesoplenty.common.world.features.trees;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
public class WorldGenBrush2 extends WorldGenAbstractTree
{
public WorldGenBrush2()
private Block wood;
private Block leaves;
private int woodMeta;
private int leavesMeta;
private List soilBlocks;
public WorldGenBrush2(Block wood, Block leaves, int woodMeta, int leavesMeta, Block... soilBlocks)
{
super(false);
this.wood = wood;
this.leaves = leaves;
this.leavesMeta = leavesMeta;
this.woodMeta = woodMeta;
this.soilBlocks = Arrays.asList(soilBlocks);
}
@Override
@ -26,7 +43,7 @@ public class WorldGenBrush2 extends WorldGenAbstractTree
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (block != Blocks.grass)
if (!soilBlocks.contains(block))
{
return false;
}
@ -42,25 +59,27 @@ public class WorldGenBrush2 extends WorldGenAbstractTree
}
}
//TODO: getBlock()
world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, x, y, z);
//TODO: setBlock()
world.func_147449_b(x, y, z, Blocks.dirt);
world.func_147465_d(x, y + 1, z, Blocks.log, 3, 2);
world.func_147465_d(x, y + 2, z, Blocks.log, 3, 2);
world.func_147465_d(x, y + 3, z, Blocks.log, 3, 2);
world.func_147465_d(x, y + 4, z, Blocks.log, 3, 2);
world.func_147449_b(x + 1, y + 4, z, Blocks.leaves);
world.func_147449_b(x - 1, y + 4, z, Blocks.leaves);
world.func_147449_b(x, y + 4, z + 1, Blocks.leaves);
world.func_147449_b(x, y + 4, z - 1, Blocks.leaves);
world.func_147449_b(x + 1, y + 4, z + 1, Blocks.leaves);
world.func_147449_b(x + 1, y + 4, z - 1, Blocks.leaves);
world.func_147449_b(x - 1, y + 4, z + 1, Blocks.leaves);
world.func_147449_b(x - 1, y + 4, z - 1, Blocks.leaves);
world.func_147449_b(x + 1, y + 5, z, Blocks.leaves);
world.func_147449_b(x - 1, y + 5, z, Blocks.leaves);
world.func_147449_b(x, y + 5, z + 1, Blocks.leaves);
world.func_147449_b(x, y + 5, z - 1, Blocks.leaves);
world.func_147449_b(x, y + 5, z, Blocks.leaves);
world.func_147465_d(x, y + 1, z, wood, woodMeta, 2);
world.func_147465_d(x, y + 2, z, wood, woodMeta, 2);
world.func_147465_d(x, y + 3, z, wood, woodMeta, 2);
world.func_147465_d(x, y + 4, z, wood, woodMeta, 2);
world.func_147465_d(x + 1, y + 4, z, leaves, leavesMeta, 2);
world.func_147465_d(x - 1, y + 4, z, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 4, z + 1, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 4, z - 1, leaves, leavesMeta, 2);
world.func_147465_d(x + 1, y + 4, z + 1, leaves, leavesMeta, 2);
world.func_147465_d(x + 1, y + 4, z - 1, leaves, leavesMeta, 2);
world.func_147465_d(x - 1, y + 4, z + 1, leaves, leavesMeta, 2);
world.func_147465_d(x - 1, y + 4, z - 1, leaves, leavesMeta, 2);
world.func_147465_d(x + 1, y + 5, z, leaves, leavesMeta, 2);
world.func_147465_d(x - 1, y + 5, z, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 5, z + 1, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 5, z - 1, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 5, z, leaves, leavesMeta, 2);
return true;
}
}

View file

@ -1,56 +0,0 @@
package biomesoplenty.common.world.features.trees;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
public class WorldGenChaparral2 extends WorldGenAbstractTree
{
public WorldGenChaparral2()
{
super(false);
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//TODO: isAirBlock()
while (world.func_147437_c(x, y, z) && y > 2)
{
--y;
}
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (block != Blocks.grass && block != Blocks.sand)
return false;
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
//TODO: isAirBlock() isAirBlock()
if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8))
return false;
}
}
//TODO: setBlock()
world.func_147449_b(x, y, z, Blocks.dirt);
world.func_147449_b(x, y + 1, z, Blocks.log);
world.func_147449_b(x, y + 2, z, Blocks.log);
world.func_147449_b(x + 1, y + 2, z, Blocks.leaves);
world.func_147449_b(x - 1, y + 2, z, Blocks.leaves);
world.func_147449_b(x, y + 2, z + 1, Blocks.leaves);
world.func_147449_b(x, y + 2, z - 1, Blocks.leaves);
world.func_147449_b(x, y + 3, z, Blocks.leaves);
return true;
}
}
}

View file

@ -0,0 +1,76 @@
package biomesoplenty.common.world.features.trees;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
public class WorldGenMiniShrub extends WorldGenAbstractTree
{
private Block wood;
private Block leaves;
private int woodMeta;
private int leavesMeta;
private List soilBlocks;
public WorldGenMiniShrub(Block wood, Block leaves, int woodMeta, int leavesMeta, Block... soilBlocks)
{
super(false);
this.wood = wood;
this.leaves = leaves;
this.leavesMeta = leavesMeta;
this.woodMeta = woodMeta;
this.soilBlocks = Arrays.asList(soilBlocks);
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//TODO: isAirBlock()
while (world.func_147437_c(x, y, z) && y > 2)
{
--y;
}
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (!soilBlocks.contains(block))
{
return false;
}
else
{
for (int var7 = -2; var7 <= 2; ++var7)
{
for (int var8 = -2; var8 <= 2; ++var8)
{
//TODO: isAirBlock() isAirBlock()
if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8))
return false;
}
}
//TODO: getBlock()
world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, x, y, z);
//TODO: setBlock()
world.func_147465_d(x, y + 1, z, wood, woodMeta, 2);
world.func_147465_d(x, y + 2, z, wood, woodMeta, 2);
world.func_147465_d(x + 1, y + 2, z, leaves, leavesMeta, 2);
world.func_147465_d(x - 1, y + 2, z, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 2, z + 1, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 2, z - 1, leaves, leavesMeta, 2);
world.func_147465_d(x, y + 3, z, leaves, leavesMeta, 2);
return true;
}
}
}

View file

@ -3,7 +3,6 @@ package biomesoplenty.common.world.generation;
import java.util.HashMap;
import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.feature.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -11,6 +10,7 @@ import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenGrassSplatter;
import biomesoplenty.common.world.features.WorldGenRiverCane;
import biomesoplenty.common.world.features.WorldGenSplotches;
import biomesoplenty.common.world.features.WorldGenWaterReeds;
@ -66,6 +66,7 @@ public class WorldGenFieldAssociation
associateField("oasesPerChunk", new WorldGenWaterside(Blocks.grass, 7, Blocks.sand, BOPBlockHelper.get("redRock")));
associateField("minersDelightPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 6));
associateField("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15));
associateField("grassSplatterPerChunk", new WorldGenGrassSplatter());
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));