Random palm trees
This commit is contained in:
parent
2e6207e73d
commit
c98636b6de
2 changed files with 138 additions and 336 deletions
|
@ -3,6 +3,7 @@ package biomesoplenty.worldgen.tree;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import biomesoplenty.api.Blocks;
|
||||
|
@ -20,7 +21,9 @@ public class WorldGenPalmTree1 extends WorldGenerator
|
|||
int var6 = var1.getBlockId(var3, var4, var5);
|
||||
|
||||
if (var6 != Block.grass.blockID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int var7 = -2; var7 <= 2; ++var7)
|
||||
|
@ -28,189 +31,79 @@ public class WorldGenPalmTree1 extends WorldGenerator
|
|||
for (int var8 = -2; var8 <= 2; ++var8)
|
||||
{
|
||||
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int var99 = var2.nextInt(4);
|
||||
|
||||
if (var99 == 0)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 10, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 11, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 1, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 2, var4 + 13, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
}
|
||||
|
||||
if (var99 == 1)
|
||||
//settings========
|
||||
double strength = var2.nextInt(35) / 100D;
|
||||
//================
|
||||
|
||||
double xoff = 0;
|
||||
double yoff = 0;
|
||||
int r = var2.nextInt(4);
|
||||
if(r == 0) { xoff = strength; }
|
||||
else if(r == 1) { xoff = -strength; }
|
||||
else if(r == 2) { yoff = strength; }
|
||||
else { yoff = -strength; }
|
||||
|
||||
int h = 1;
|
||||
buildBlock(var1, var3, var4, var5, Block.dirt.blockID, 0);
|
||||
for(int b = 0; b < 10; b++)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 10, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 11, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 4, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 3, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 3, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 13, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
buildBlock(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)), Blocks.logs2.get().blockID, 3);
|
||||
if(b == 9)
|
||||
{
|
||||
generateTop(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)));
|
||||
}
|
||||
|
||||
if (var99 == 2)
|
||||
else
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 + 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 9, var5 + 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5 + 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5 + 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 13, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 14, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
h++;
|
||||
xoff *= 1.3D;
|
||||
yoff *= 1.3D;
|
||||
}
|
||||
|
||||
if (var99 == 3)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 - 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 9, var5 - 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5 - 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5 - 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 13, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 14, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void generateTop(World world, int x, int y, int z)
|
||||
{
|
||||
buildBlock(world, x + 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y - 1, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y - 1, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 1, y, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 2, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 2, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
}
|
||||
|
||||
public void buildBlock(World world, int x, int y, int z, int id, int meta)
|
||||
{
|
||||
Material m = world.getBlockMaterial(x, y, z);
|
||||
if(m == Material.air || m == Material.leaves)
|
||||
{
|
||||
world.setBlock(x, y, z, id, meta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package biomesoplenty.worldgen.tree;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import biomesoplenty.api.Blocks;
|
||||
|
@ -20,7 +21,9 @@ public class WorldGenPalmTree3 extends WorldGenerator
|
|||
int var6 = var1.getBlockId(var3, var4, var5);
|
||||
|
||||
if (var6 != Block.grass.blockID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int var7 = -2; var7 <= 2; ++var7)
|
||||
|
@ -28,173 +31,79 @@ public class WorldGenPalmTree3 extends WorldGenerator
|
|||
for (int var8 = -2; var8 <= 2; ++var8)
|
||||
{
|
||||
if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int var99 = var2.nextInt(4);
|
||||
|
||||
if (var99 == 0)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 3, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 + 2, var4 + 9, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 4, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
}
|
||||
|
||||
if (var99 == 1)
|
||||
//settings========
|
||||
double strength = var2.nextInt(25) / 100D;
|
||||
//================
|
||||
|
||||
double xoff = 0;
|
||||
double yoff = 0;
|
||||
int r = var2.nextInt(4);
|
||||
if(r == 0) { xoff = strength; }
|
||||
else if(r == 1) { xoff = -strength; }
|
||||
else if(r == 2) { yoff = strength; }
|
||||
else { yoff = -strength; }
|
||||
|
||||
int h = 1;
|
||||
buildBlock(var1, var3, var4, var5, Block.dirt.blockID, 0);
|
||||
for(int b = 0; b < 8; b++)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 3, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 4, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 3, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 3, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 9, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 4, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
buildBlock(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)), Blocks.logs2.get().blockID, 3);
|
||||
if(b == 7)
|
||||
{
|
||||
generateTop(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)));
|
||||
}
|
||||
|
||||
if (var99 == 2)
|
||||
else
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5 + 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5 + 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 + 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 9, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
h++;
|
||||
xoff *= 1.5D;
|
||||
yoff *= 1.5D;
|
||||
}
|
||||
|
||||
if (var99 == 3)
|
||||
{
|
||||
var1.setBlock(var3, var4, var5, Block.dirt.blockID);
|
||||
var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 5, var5 - 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 6, var5 - 1, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 - 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.logs2.get().blockID, 3, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 - 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3, var4 + 9, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
|
||||
var1.setBlock(var3 - 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3 + 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void generateTop(World world, int x, int y, int z)
|
||||
{
|
||||
buildBlock(world, x + 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y - 1, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y - 1, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 1, y, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x + 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 1, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
|
||||
buildBlock(world, x + 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x - 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 2, z + 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
buildBlock(world, x, y + 2, z - 2, Blocks.leavesColorized.get().blockID, 2);
|
||||
}
|
||||
|
||||
public void buildBlock(World world, int x, int y, int z, int id, int meta)
|
||||
{
|
||||
Material m = world.getBlockMaterial(x, y, z);
|
||||
if(m == Material.air || m == Material.leaves)
|
||||
{
|
||||
world.setBlock(x, y, z, id, meta, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue