I'm trying to make my leavers not move, I textured them really cool and its just better when they don't move, I pinpointed the part that makes the leaver move and tried for about half a hour to fix it but couldn't get it, if someone could try to make leavers not move that would be awesome!
(when i right click on them)
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
int var10 = par1World.getBlockMetadata(par2, par3, par4);
int var11 = var10 & 7;
int var12 = 8 - (var10 & 8);
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3);
(when i right click on them)
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
int var10 = par1World.getBlockMetadata(par2, par3, par4);
int var11 = var10 & 7;
int var12 = 8 - (var10 & 8);
par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3);
if (var11 == 1)
{
par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID);
}
else if (var11 == 2)
{
par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID);
}
else if (var11 == 3)
{
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID);
}
else if (var11 == 4)
{
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID);
}
else if (var11 != 5 && var11 != 6)
{
if (var11 == 0 || var11 == 7)
{
par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID);
}
}
else
{
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
}
return true;
}
}
Makes you'r game smoother and funner to play all the time! Click The Picture!