Tweaked the generation of Cattail.
This commit is contained in:
parent
fb1c0b362a
commit
f05287a236
1 changed files with 9 additions and 7 deletions
|
@ -6,29 +6,31 @@ import biomesoplenty.api.Blocks;
|
|||
import biomesoplenty.configuration.BOPBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenCattail extends WorldGenerator
|
||||
{
|
||||
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
|
||||
public boolean generate(World world, Random par2Random, int par3, int par4, int par5)
|
||||
{
|
||||
int var11;
|
||||
|
||||
for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4)
|
||||
for (boolean var6 = false; ((var11 = world.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
for (int var7 = 0; var7 < 128; ++var7)
|
||||
{
|
||||
int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
|
||||
int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
int x = par3 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
int y = par4 + par2Random.nextInt(4) - par2Random.nextInt(4);
|
||||
int z = par5 + par2Random.nextInt(8) - par2Random.nextInt(8);
|
||||
|
||||
if (par1World.isAirBlock(var8, var9, var10) && Blocks.plants.get().canBlockStay(par1World, var8, var9, var10))
|
||||
if (world.isAirBlock(x, y, z) && Blocks.plants.get().canBlockStay(world, x, y, z))
|
||||
{
|
||||
par1World.setBlock(var8, var9, var10, Blocks.plants.get().blockID, 7, 2);
|
||||
if ((world.getBlockMaterial(x - 1, y - 1, z) == Material.water ? true : (world.getBlockMaterial(x + 1, y - 1, z) == Material.water ? true : (world.getBlockMaterial(x, y - 1, z - 1) == Material.water ? true : world.getBlockMaterial(x, y - 1, z + 1) == Material.water))))
|
||||
world.setBlock(x, y, z, Blocks.plants.get().blockID, 7, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue