public ItemStack dispenseItem(ItemStack it, boolean sim) {
   ForgeDirection side = getSideFacing();
   TileEntity te =
       worldObj.getTileEntity(xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ);
   if (te != null && te instanceof IInventory) {
     ItemStack rem = ItemUtil.addItemToNearbyInventories(this, it, false, sim, side);
     return rem;
   } else {
     if (!sim) {
       BlockSourceImpl impl = new BlockSourceImpl(worldObj, xCoord, yCoord, zCoord);
       BehaviorDefaultDispenseItem.doDispense(
           worldObj,
           it,
           6,
           BlockDispenser.func_149937_b(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)),
           BlockDispenser.func_149939_a(impl));
     }
     return null;
   }
 }