/** Called whenever the block is added into the world. Args: world, x, y, z */ public void onBlockAdded(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null && !ignoreUpdates) { updatePistonState(par1World, par2, par3, par4); } }
/** Called when the block is placed in the world. */ public void onBlockPlacedBy( World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { int i = determineOrientation(par1World, par2, par3, par4, (EntityPlayer) par5EntityLiving); par1World.setBlockMetadataWithNotify(par2, par3, par4, i); if (!par1World.isRemote && !ignoreUpdates) { updatePistonState(par1World, par2, par3, par4); } }
/** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed * (coordinates passed are their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { if (!par1World.isRemote && !ignoreUpdates) { updatePistonState(par1World, par2, par3, par4); } }