Made moss not spread

This commit is contained in:
Matt Caughey 2013-09-20 19:40:54 -04:00
parent 88baea8581
commit 1f555597b8
2 changed files with 1 additions and 131 deletions

View file

@ -266,136 +266,6 @@ public class BlockMoss extends Block
@Override
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote && par1World.rand.nextInt(15) == 0)
{
byte var6 = 4;
int var7 = 5;
boolean var8 = false;
int var9;
int var10;
int var11;
label138:
for (var9 = par2 - var6; var9 <= par2 + var6; ++var9)
{
for (var10 = par4 - var6; var10 <= par4 + var6; ++var10)
{
for (var11 = par3 - 1; var11 <= par3 + 1; ++var11)
{
if (par1World.getBlockId(var9, var11, var10) == blockID)
{
--var7;
if (var7 <= 0)
{
var8 = true;
break label138;
}
}
}
}
}
var9 = par1World.getBlockMetadata(par2, par3, par4);
var10 = par1World.rand.nextInt(6);
var11 = Direction.facingToDirection[var10];
int var12;
int var13;
if (var10 == 1 && par3 < 255 && par1World.isAirBlock(par2, par3 + 1, par4))
{
if (var8)
return;
var12 = par1World.rand.nextInt(16) & var9;
if (var12 > 0)
{
for (var13 = 0; var13 <= 3; ++var13)
{
if (!this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3 + 1, par4 + Direction.offsetZ[var13])))
{
var12 &= ~(1 << var13);
}
}
if (var12 > 0)
{
par1World.setBlock(par2, par3 + 1, par4, blockID, var12, 2);
}
}
}
else
{
int var14;
if (var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0)
{
if (var8)
return;
var12 = par1World.getBlockId(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11]);
if (var12 != 0 && Block.blocksList[var12] != null)
{
if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock())
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2);
}
}
else
{
var13 = var11 + 1 & 3;
var14 = var11 + 3 & 3;
if ((var9 & 1 << var13) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13])))
{
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], blockID, 1 << var13, 2);
}
else if ((var9 & 1 << var14) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14])))
{
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], blockID, 1 << var14, 2);
}
else if ((var9 & 1 << var13) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var13])))
{
par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], blockID, 1 << (var11 + 2 & 3), 2);
}
else if ((var9 & 1 << var14) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var14])))
{
par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], blockID, 1 << (var11 + 2 & 3), 2);
}
else if (this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11], par3 + 1, par4 + Direction.offsetZ[var11])))
{
par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], blockID, 0, 2);
}
}
}
else if (par3 > 1)
{
var12 = par1World.getBlockId(par2, par3 - 1, par4);
if (var12 == 0)
{
var13 = par1World.rand.nextInt(16) & var9;
if (var13 > 0)
{
par1World.setBlock(par2, par3 - 1, par4, blockID, var13, 2);
}
}
else if (var12 == blockID)
{
var13 = par1World.rand.nextInt(16) & var9;
var14 = par1World.getBlockMetadata(par2, par3 - 1, par4);
if (var14 != (var14 | var13))
{
par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2);
}
}
}
}
}
}
/**

View file

@ -23,7 +23,7 @@ public class WorldGenMoss extends WorldGenerator
{
if (Blocks.moss.get().canPlaceBlockOnSide(par1World, par3, par4, par5, var8))
{
int var999 = par2Random.nextInt(2);
int var999 = par2Random.nextInt(3);
if (var999 == 0)
{