Trying to get rivercane to work, but it seems to still drop off when a block is generated next to one of the segments higher than the bottom

This commit is contained in:
Adubbz 2014-01-03 23:13:03 +11:00
parent a101a7e2dc
commit d5626bddc8
3 changed files with 18 additions and 22 deletions

View file

@ -216,19 +216,15 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable
world.func_147468_f(x, y, z);
}
//TODO: getBlock()
else if (world.func_147439_a(x, y, z) != this || world.getBlockMetadata(x, y, z) != 8)
else if (world.getBlockMetadata(x, y, z) == 8)
{
//TODO: getBlock()
for (int i = 1; world.func_147439_a(x, y + i, z) == this; i++)
//TODO: canReplace()
if (!this.func_149705_a(world, x, y, z, 0, new ItemStack(BOPBlockHelper.get("plants"), 1, 8)))
{
//TODO: canBlockStay()
if (!this.func_149718_j(world, x, y + i, z))
{
//TODO: dropBlockAsItem
this.func_149697_b(world, x, y + i, z, world.getBlockMetadata(x, y + i, z), 0);
//TODO: setBlockToAir()
world.func_147468_f(x, y, z);
}
//TODO: dropBlockAsItem
this.func_149697_b(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
//TODO: setBlockToAir()
world.func_147468_f(x, y, z);
}
}
}
@ -282,7 +278,7 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable
return new ItemStack(BOPItemHelper.get("food"));
}
return new ItemStack(this, 1);
return new ItemStack(this, 1, meta);
}
@Override

View file

@ -11,7 +11,7 @@ public class WorldGenBOPFlora extends WorldGenerator
{
private Block flora;
private int floraMeta;
private int groupCount = 64;
private int groupCount = 7;
public WorldGenBOPFlora(Block flora, int floraMeta)
{

View file

@ -10,23 +10,23 @@ import biomesoplenty.api.BOPBlockHelper;
public class WorldGenRiverCane extends WorldGenerator
{
@Override
public boolean generate(World world, Random par2Random, int par3, int par4, int par5)
public boolean generate(World world, Random par2Random, int x, int y, int z)
{
for (int l = 0; l < 30; ++l)
for (int l = 0; l < 5; ++l)
{
int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
int j1 = par4;
int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
int i1 = x + par2Random.nextInt(8) - par2Random.nextInt(8);
int j1 = y;
int k1 = z + par2Random.nextInt(8) - par2Random.nextInt(8);
//TODO: isAirBlock()
if (world.func_147437_c(i1, par4, k1))
if (world.func_147437_c(i1, j1, k1))
{
int l1 = 1 + par2Random.nextInt(par2Random.nextInt(3) + 1);
//TODO: canReplace()
if (BOPBlockHelper.get("plants").func_149705_a(world, i1, j1, k1, 0, new ItemStack(BOPBlockHelper.get("plants"), 8, 2)))
for (int i2 = 0; i2 < l1; ++i2)
{
for (int i2 = 0; i2 < l1; ++i2)
//TODO: canReplace()
if (BOPBlockHelper.get("plants").func_149705_a(world, i1, j1, k1, 0, new ItemStack(BOPBlockHelper.get("plants"), 1, 8)))
{
//TODO: setBlock()
world.func_147465_d(i1, j1 + i2, k1, BOPBlockHelper.get("plants"), 8, 2);