Ejemplo n.º 1
0
  /** ejects contained items into the world, and notifies neighbours of an update, as appropriate */
  public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
    super.breakBlock(par1World, par2, par3, par4, par5, par6);
    int var7 = Facing.faceToSide[getDirectionMeta(par6)];
    par2 += Facing.offsetsXForSide[var7];
    par3 += Facing.offsetsYForSide[var7];
    par4 += Facing.offsetsZForSide[var7];
    int var8 = par1World.getBlockId(par2, par3, par4);

    if (var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) {
      par6 = par1World.getBlockMetadata(par2, par3, par4);

      if (BlockPistonBase.isExtended(par6)) {
        Block.blocksList[var8].dropBlockAsItem(par1World, par2, par3, par4, par6, 0);
        par1World.setBlockToAir(par2, par3, par4);
      }
    }
  }
Ejemplo n.º 2
0
  public void func_56322_a(World par1World, int par2, int par3, int par4, int par5, int par6) {
    super.func_56322_a(par1World, par2, par3, par4, par5, par6);
    int i = Facing.faceToSide[getDirectionMeta(par6)];
    par2 += Facing.offsetsXForSide[i];
    par3 += Facing.offsetsYForSide[i];
    par4 += Facing.offsetsZForSide[i];
    int j = par1World.getBlockId(par2, par3, par4);

    if (j == Block.pistonBase.blockID || j == Block.pistonStickyBase.blockID) {
      par6 = par1World.getBlockMetadata(par2, par3, par4);

      if (BlockPistonBase.isExtended(par6)) {
        Block.blocksList[j].dropBlockAsItem(par1World, par2, par3, par4, par6, 0);
        par1World.setBlockWithNotify(par2, par3, par4, 0);
      }
    }
  }
  /** Called whenever the block is removed. */
  public void onBlockRemoval(World par1World, int par2, int par3, int par4) {
    super.onBlockRemoval(par1World, par2, par3, par4);
    int i = par1World.getBlockMetadata(par2, par3, par4);
    int k = Facing.faceToSide[getDirectionMeta(i)];
    par2 += Facing.offsetsXForSide[k];
    par3 += Facing.offsetsYForSide[k];
    par4 += Facing.offsetsZForSide[k];
    int l = par1World.getBlockId(par2, par3, par4);

    if (l == Block.pistonBase.blockID || l == Block.pistonStickyBase.blockID) {
      int j = par1World.getBlockMetadata(par2, par3, par4);

      if (BlockPistonBase.isExtended(j)) {
        Block.blocksList[l].dropBlockAsItem(par1World, par2, par3, par4, j, 0);
        par1World.setBlockWithNotify(par2, par3, par4, 0);
      }
    }
  }