Hey guys,
as the title is a give away i wanna go into a little detail
so im making a mod and and putting a step on it but i cant make it so when 1 is placed onto another it should stack
the files ive got are
BlockWhiteGoldSingle
BlockWhiteGoldDouble
mod_whiteGold
using the
Code:
public void onBlockAdded(World world, int i, int j, int k)
{
if(this != Block.whiteGoldSingle)
{
super.onBlockAdded(world, i, j, k);
}
int l = world.getBlockId(i, j - 1, k);
int i1 = world.getBlockMetadata(i, j, k);
int j1 = world.getBlockMetadata(i, j - 1, k);
if(i1 != j1)
{
return;
}
if(l == whiteGoldSingle.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
world.setBlockAndMetadataWithNotify(i, j - 1, k, Block.whiteGoldDouble.blockID, i1);
}
}
how would i go about re-arranging it to work properly
thanks in advance
Ok, Ive Done This
Code:
public void onBlockAdded(World world, int i, int j, int k)
{
if(world.getBlockId(i, j -, k)!= Block.whiteGoldSingle)
{
int l = world.getBlockId(i, j - 1, k);
int i1 = world.getBlockMetadata(i, j, k);
int j1 = world.getBlockMetadata(i, j - 1, k);
if(i1 != j1)
{
return;
}
if(l == whiteGoldSingle.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
world.setBlockAndMetadataWithNotify(i, j - 1, k, Block.whiteGoldDouble.blockID, i1);
}
}
}
But Im Still Getting An Error;
Code:
src\minecraft\net\minecraft\src\BlockWhiteGoldSingle.java:22: illegal start of expression
if(world.getBlockId(i, j -, k)!= Block.whiteGoldSingle)
^