Readded most of the saplings, with the only ones remaining being those for trees that are unused (for now) (Persimmon, Hellbark, Holy, Apple & Mangrove)

This commit is contained in:
Adubbz 2014-01-15 14:43:21 +11:00
parent 77b8dd391a
commit 07e0e399fa
3 changed files with 57 additions and 42 deletions

View file

@ -12,10 +12,15 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import biomesoplenty.BiomesOPlenty; import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenPalmTree1;
import biomesoplenty.common.world.features.trees.WorldGenPineTree; import biomesoplenty.common.world.features.trees.WorldGenPineTree;
import biomesoplenty.common.world.features.trees.WorldGenRedwoodTree2;
import biomesoplenty.common.world.features.trees.WorldGenSacredOak; import biomesoplenty.common.world.features.trees.WorldGenSacredOak;
public class BlockBOPColorizedSapling extends BlockSapling public class BlockBOPColorizedSapling extends BlockSapling
@ -134,25 +139,23 @@ public class BlockBOPColorizedSapling extends BlockSapling
/*case 1: // Mangrove Tree /*case 1: // Mangrove Tree
obj = new WorldGenMangrove(false); obj = new WorldGenMangrove(false);
break; break;*/
case 2: // Palm Tree case 2: // Palm Tree
rnd = random.nextInt(4); rnd = random.nextInt(4);
if (rnd == 0) { if (rnd == 0) obj = new WorldGenPalmTree1();
obj = new WorldGenPalmTree1(); else obj = new WorldGenPalmTree1(25, 8, 1.5D);
} else {
obj = new WorldGenPalmTree3();
}
break; break;
case 3: // Redwood Tree case 3: // Redwood Tree
obj = new WorldGenRedwoodTree2(false); obj = new WorldGenRedwoodTree2(BOPBlockHelper.get("logs3"), BOPBlockHelper.get("colorizedLeaves1"), 0, 3, false, 20, 15);
break; break;
case 4: // Willow Tree case 4: // Willow Tree
obj = new WorldGenWillow(); obj = new WorldGenBOPSwampTree(BOPBlockHelper.get("logs3"), BOPBlockHelper.get("colorizedLeaves2"), 1, 0, 6, 9, BOPBlockHelper.get("colorizedLeaves2"), 0);
break;*/ break;
case 5: // Pine Tree case 5: // Pine Tree
obj = new WorldGenPineTree(); obj = new WorldGenPineTree();

View file

@ -16,6 +16,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import biomesoplenty.BiomesOPlenty; import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBlockHelper; import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.trees.WorldGenBOPBigTree;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree; import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2; import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import biomesoplenty.common.world.features.trees.WorldGenBulbTree; import biomesoplenty.common.world.features.trees.WorldGenBulbTree;
@ -70,12 +71,12 @@ public class BlockBOPSapling extends BlockSapling
list.add(new ItemStack(block, 1, i)); list.add(new ItemStack(block, 1, i));
} }
} }
public boolean isValidPosition(World world, int x, int y, int z, int metadata) public boolean isValidPosition(World world, int x, int y, int z, int metadata)
{ {
//TODO: getBlock() //TODO: getBlock()
Block block = world.func_147439_a(x, y - 1, z); Block block = world.func_147439_a(x, y - 1, z);
switch (metadata) switch (metadata)
{ {
case 7: // Loftwood case 7: // Loftwood
@ -99,7 +100,7 @@ public class BlockBOPSapling extends BlockSapling
{ {
//TODO: getBlock() //TODO: getBlock()
Block soil = world.func_147439_a(x, y - 1, z); Block soil = world.func_147439_a(x, y - 1, z);
if (world.getBlockMetadata(x, y, z) != 1) if (world.getBlockMetadata(x, y, z) != 1)
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) &&
(soil != null && soil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this)); (soil != null && soil.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this));
@ -136,11 +137,11 @@ public class BlockBOPSapling extends BlockSapling
{ {
/*case 0: // Apple Tree /*case 0: // Apple Tree
obj = new WorldGenApple(false); obj = new WorldGenApple(false);
break; break;*/
case 1: // Autumn Tree case 1: // Autumn Tree
obj = new WorldGenAutumn(false); obj = new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves1"), 2, 0, false, 5, 3, false);
break;*/ break;
case 2: // Bamboo Tree case 2: // Bamboo Tree
rnd = random.nextInt(8); rnd = random.nextInt(8);
@ -152,61 +153,59 @@ public class BlockBOPSapling extends BlockSapling
} }
break; break;
/*case 3: // Magic Tree case 3: // Magic Tree
obj = new WorldGenMystic2(false); obj = new WorldGenOriginalTree(BOPBlockHelper.get("logs2"), BOPBlockHelper.get("leaves1"), 1, 2, false, 5, 3, false);
break; break;
*/case 4: // Dark Tree case 4: // Dark Tree
rnd = random.nextInt(8); rnd = random.nextInt(8);
if (rnd == 0) { if (rnd == 0) obj = new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, 5, 4);
obj = new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, 5, 4); else obj = new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, false, 14, 6, 0);
} else {
obj = new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, false, 14, 6, 0);
}
break; break;
/*case 5: // Dead Tree case 5: // Dead Tree
obj = new WorldGenDeadTree2(false); obj = new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves2"), 0, 0, false, 5, 3, false);
break; break;
case 6: // Fir Tree case 6: // Fir Tree
obj = new WorldGenTaiga9(false); obj = new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves2"), 3, 1, false, 10, 10, 5);
break; break;
case 7: // Holy Tree /*case 7: // Holy Tree
obj = new WorldGenPromisedTree(false); obj = new WorldGenPromisedTree(false);
break; break;*/
case 8: // Autumn Tree case 8: // Autumn Tree
obj = new WorldGenAutumn2(false); obj = new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves2"), 0, 3, false, 5, 3, false);
break; break;
case 9: // Origin Tree case 9: // Origin Tree
obj = new WorldGenOriginTree(false); obj = new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves3"), 0, 0, false, 5, 3, false);
break; break;
case 10: // Pink Cherry Tree case 10: // Pink Cherry Tree
obj = new WorldGenCherry1(false); obj = new WorldGenBOPBigTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves3"), 1, 1);
break; break;
case 11: // Maple Tree case 11: // Maple Tree
obj = new WorldGenMaple(false); obj = new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves3"), 0, 2, false, 5, 3, false);
break; break;
case 12: // White Cherry Tree case 12: // White Cherry Tree
obj = new WorldGenCherry2(false); obj = new WorldGenBOPBigTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves3"), 1, 3);
break; break;
case 13: // Hellbark /*case 13: // Hellbark
obj = new WorldGenNetherBush(); obj = new WorldGenNetherBush();
break;*/ break;*/
case 14: // Jacaranda case 14: // Jacaranda
obj = new WorldGenOriginalTree(BOPBlockHelper.get("logs4"), BOPBlockHelper.get("leaves4"), 2, 1); obj = new WorldGenOriginalTree(BOPBlockHelper.get("logs4"), BOPBlockHelper.get("leaves4"), 2, 1);
break; break;
/*case 15: // Persimmon /*case 15: // Persimmon
obj = new WorldGenPersimmon(false); obj = new WorldGenPersimmon(false);
break;*/ break;*/
} }

View file

@ -10,9 +10,22 @@ import biomesoplenty.api.BOPBlockHelper;
public class WorldGenPalmTree1 extends WorldGenAbstractTree public class WorldGenPalmTree1 extends WorldGenAbstractTree
{ {
public WorldGenPalmTree1() private int strengthRand;
private int bMax;
private double offset;
public WorldGenPalmTree1()
{
this(35, 10, 1.3D);
}
public WorldGenPalmTree1(int strengthRand, int bMax, double offset)
{ {
super(false); super(false);
this.strengthRand = strengthRand;
this.bMax = bMax;
this.offset = offset;
} }
@Override @Override
@ -46,7 +59,7 @@ public class WorldGenPalmTree1 extends WorldGenAbstractTree
} }
//settings======== //settings========
double strength = random.nextInt(35) / 100D; double strength = random.nextInt(strengthRand) / 100D;
//================ //================
double xoff = 0; double xoff = 0;
@ -59,18 +72,18 @@ public class WorldGenPalmTree1 extends WorldGenAbstractTree
int h = 1; int h = 1;
buildBlock(world, x, y, z, Blocks.dirt, 0); buildBlock(world, x, y, z, Blocks.dirt, 0);
for(int b = 0; b < 10; b++) for(int b = 0; b < bMax; b++)
{ {
buildBlock(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff)), BOPBlockHelper.get("logs2"), 3); buildBlock(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff)), BOPBlockHelper.get("logs2"), 3);
if(b == 9) if(b == bMax - 1)
{ {
generateTop(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff))); generateTop(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff)));
} }
else else
{ {
h++; h++;
xoff *= 1.3D; xoff *= offset;
yoff *= 1.3D; yoff *= offset;
} }
} }